This commit is contained in:
Gordon 2022-12-10 20:12:13 +08:00
parent 6f20cdd905
commit a0520ce5d8
2 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package msg
import ( import (
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/proto/msg" "Open_IM/pkg/proto/msg"
"Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
@ -40,6 +41,7 @@ func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.M
if !isExists { if !isExists {
if !req.IsReact { if !req.IsReact {
log.Debug(req.OperationID, "redis handle firstly", req.String())
oneExtendMsg.MsgFirstModifyTime = utils.GetCurrentTimestampByMill() oneExtendMsg.MsgFirstModifyTime = utils.GetCurrentTimestampByMill()
//redis处理 //redis处理
for k, v := range req.ReactionExtensionList { for k, v := range req.ReactionExtensionList {
@ -76,6 +78,8 @@ func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.M
} }
} else { } else {
log.Debug(req.OperationID, "redis handle secondly", req.String())
for k, v := range req.ReactionExtensionList { for k, v := range req.ReactionExtensionList {
//抢占分布式锁 //抢占分布式锁
err := lockMessageTypeKey(req.ClientMsgID, k) err := lockMessageTypeKey(req.ClientMsgID, k)

View File

@ -9,5 +9,5 @@ import (
func ExtendMessageUpdatedNotification(operationID, changedUserID string, needNotifiedUserID string, opUserID string) { func ExtendMessageUpdatedNotification(operationID, changedUserID string, needNotifiedUserID string, opUserID string) {
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID} selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: needNotifiedUserID, OpUserID: opUserID, OperationID: operationID} commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: needNotifiedUserID, OpUserID: opUserID, OperationID: operationID}
friendNotification(&commID, constant.FriendInfoUpdatedNotification, &selfInfoUpdatedTips) friendNotification(&commID, constant.ReactionMessageModifierNotification, &selfInfoUpdatedTips)
} }