mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Separate the notification
This commit is contained in:
parent
189911c77f
commit
5d4600a080
@ -665,6 +665,19 @@ notification:
|
||||
defaultTips:
|
||||
tips: "Remove a blocked user"
|
||||
|
||||
friendInfoUpdated:
|
||||
conversation:
|
||||
reliabilityLevel: 2
|
||||
unreadCount: false
|
||||
offlinePush:
|
||||
switch: true
|
||||
title: "friend info updated"
|
||||
desc: "friend info updated"
|
||||
ext: "friend info updated"
|
||||
defaultTips:
|
||||
tips: "friend info updated"
|
||||
|
||||
|
||||
#####################user#########################
|
||||
userInfoUpdated:
|
||||
conversation:
|
||||
|
@ -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 != "" {
|
||||
|
@ -456,6 +456,12 @@ type config struct {
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||
} `yaml:"blackDeleted"`
|
||||
FriendInfoUpdated struct {
|
||||
Conversation PConversation `yaml:"conversation"`
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||
} `yaml:"friendInfoUpdated"`
|
||||
|
||||
ConversationOptUpdate struct {
|
||||
Conversation PConversation `yaml:"conversation"`
|
||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||
|
@ -65,6 +65,7 @@ const (
|
||||
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
||||
BlackAddedNotification = 1207 //add_black
|
||||
BlackDeletedNotification = 1208 //remove_black
|
||||
FriendInfoUpdatedNotification = 1209
|
||||
|
||||
ConversationOptChangeNotification = 1300 // change conversation opt
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user