mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 03:56:00 +08:00
Separate the notification
This commit is contained in:
@@ -68,6 +68,8 @@ func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Mess
|
||||
tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname
|
||||
case constant.UserInfoUpdatedNotification:
|
||||
tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips
|
||||
case constant.FriendInfoUpdatedNotification:
|
||||
tips.DefaultTips = cn.FriendInfoUpdated.DefaultTips.Tips + toUserNickname
|
||||
default:
|
||||
log.Error(commID.OperationID, "contentType failed ", contentType)
|
||||
return
|
||||
@@ -158,8 +160,15 @@ func BlackDeletedNotification(req *pbFriend.RemoveBlacklistReq) {
|
||||
friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips)
|
||||
}
|
||||
|
||||
func UserInfoUpdatedNotification(operationID, userID string, needNotifiedUserID string) {
|
||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: needNotifiedUserID}
|
||||
commID := pbFriend.CommID{FromUserID: userID, ToUserID: needNotifiedUserID, OpUserID: userID, OperationID: operationID}
|
||||
//send to myself
|
||||
func UserInfoUpdatedNotification(operationID, opUserID string, changedUserID string) {
|
||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
||||
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: changedUserID, OpUserID: opUserID, OperationID: operationID}
|
||||
friendNotification(&commID, constant.UserInfoUpdatedNotification, &selfInfoUpdatedTips)
|
||||
}
|
||||
|
||||
func FriendInfoUpdatedNotification(operationID, changedUserID string, needNotifiedUserID string, opUserID string) {
|
||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
||||
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: needNotifiedUserID, OpUserID: opUserID, OperationID: operationID}
|
||||
friendNotification(&commID, constant.FriendInfoUpdatedNotification, &selfInfoUpdatedTips)
|
||||
}
|
||||
|
||||
@@ -444,12 +444,14 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI
|
||||
}
|
||||
for _, v := range rpcResp.FriendInfoList {
|
||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID)
|
||||
chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID)
|
||||
// chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID)
|
||||
chat.FriendInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID, req.OpUserID)
|
||||
}
|
||||
if err := rocksCache.DelUserInfoFromCache(user.UserID); err != nil {
|
||||
log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq)
|
||||
return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}}, nil
|
||||
}
|
||||
//chat.UserInfoUpdatedNotification(req.OperationID, req.OpUserID, req.UserInfo.UserID)
|
||||
chat.UserInfoUpdatedNotification(req.OperationID, req.OpUserID, req.UserInfo.UserID)
|
||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID)
|
||||
if req.UserInfo.FaceURL != "" {
|
||||
|
||||
Reference in New Issue
Block a user