diff --git a/src/api/chat/send_msg.go b/src/api/chat/send_msg.go index b6c1c75ac..ede81abdd 100644 --- a/src/api/chat/send_msg.go +++ b/src/api/chat/send_msg.go @@ -87,7 +87,7 @@ func UserSendMsg(c *gin.Context) { "data": gin.H{ "clientMsgID": reply.ClientMsgID, "serverMsgID": reply.ServerMsgID, - "sendTime": 0, + "sendTime": reply.SendTime, }, }) diff --git a/src/api/manage/management_chat.go b/src/api/manage/management_chat.go index 19c6713dd..fd9c89b27 100644 --- a/src/api/manage/management_chat.go +++ b/src/api/manage/management_chat.go @@ -125,7 +125,7 @@ func ManagementSendMsg(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "errCode": reply.ErrCode, "errMsg": reply.ErrMsg, - "sendTime": "", + "sendTime": reply.SendTime, "msgID": reply.ClientMsgID, }) diff --git a/src/rpc/chat/chat/send_msg.go b/src/rpc/chat/chat/send_msg.go index a11f929e6..0f1d2d6b0 100644 --- a/src/rpc/chat/chat/send_msg.go +++ b/src/rpc/chat/chat/send_msg.go @@ -66,7 +66,11 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* pbData.MsgID = serverMsgID pbData.OperationID = pb.OperationID pbData.Token = pb.Token - pbData.SendTime = pb.SendTime + if pb.SendTime == 0 { + pbData.SendTime = utils.GetCurrentTimestampByNano() + } else { + pbData.SendTime = pb.SendTime + } m := MsgCallBackResp{} if config.Config.MessageCallBack.CallbackSwitch { bMsg, err := http2.Post(config.Config.MessageCallBack.CallbackUrl, MsgCallBackReq{ @@ -182,5 +186,6 @@ func returnMsg(replay *pbChat.UserSendMsgResp, pb *pbChat.UserSendMsgReq, errCod replay.ReqIdentifier = pb.ReqIdentifier replay.ClientMsgID = pb.ClientMsgID replay.ServerMsgID = serverMsgID + replay.SendTime = sendTime return replay, nil }