mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 11:06:43 +08:00
Separate the notification
This commit is contained in:
parent
189911c77f
commit
5d4600a080
@ -665,6 +665,19 @@ notification:
|
|||||||
defaultTips:
|
defaultTips:
|
||||||
tips: "Remove a blocked user"
|
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#########################
|
#####################user#########################
|
||||||
userInfoUpdated:
|
userInfoUpdated:
|
||||||
conversation:
|
conversation:
|
||||||
|
@ -68,6 +68,8 @@ func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Mess
|
|||||||
tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname
|
tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname
|
||||||
case constant.UserInfoUpdatedNotification:
|
case constant.UserInfoUpdatedNotification:
|
||||||
tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips
|
tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips
|
||||||
|
case constant.FriendInfoUpdatedNotification:
|
||||||
|
tips.DefaultTips = cn.FriendInfoUpdated.DefaultTips.Tips + toUserNickname
|
||||||
default:
|
default:
|
||||||
log.Error(commID.OperationID, "contentType failed ", contentType)
|
log.Error(commID.OperationID, "contentType failed ", contentType)
|
||||||
return
|
return
|
||||||
@ -158,8 +160,15 @@ func BlackDeletedNotification(req *pbFriend.RemoveBlacklistReq) {
|
|||||||
friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips)
|
friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips)
|
||||||
}
|
}
|
||||||
|
|
||||||
func UserInfoUpdatedNotification(operationID, userID string, needNotifiedUserID string) {
|
//send to myself
|
||||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: needNotifiedUserID}
|
func UserInfoUpdatedNotification(operationID, opUserID string, changedUserID string) {
|
||||||
commID := pbFriend.CommID{FromUserID: userID, ToUserID: needNotifiedUserID, OpUserID: userID, OperationID: operationID}
|
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
||||||
|
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: changedUserID, OpUserID: opUserID, OperationID: operationID}
|
||||||
friendNotification(&commID, constant.UserInfoUpdatedNotification, &selfInfoUpdatedTips)
|
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 {
|
for _, v := range rpcResp.FriendInfoList {
|
||||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID)
|
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 {
|
if err := rocksCache.DelUserInfoFromCache(user.UserID); err != nil {
|
||||||
log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq)
|
log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq)
|
||||||
return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}}, nil
|
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)
|
chat.UserInfoUpdatedNotification(req.OperationID, req.OpUserID, req.UserInfo.UserID)
|
||||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID)
|
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID)
|
||||||
if req.UserInfo.FaceURL != "" {
|
if req.UserInfo.FaceURL != "" {
|
||||||
|
@ -456,6 +456,12 @@ type config struct {
|
|||||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
} `yaml:"blackDeleted"`
|
} `yaml:"blackDeleted"`
|
||||||
|
FriendInfoUpdated struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
|
} `yaml:"friendInfoUpdated"`
|
||||||
|
|
||||||
ConversationOptUpdate struct {
|
ConversationOptUpdate struct {
|
||||||
Conversation PConversation `yaml:"conversation"`
|
Conversation PConversation `yaml:"conversation"`
|
||||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
@ -65,6 +65,7 @@ const (
|
|||||||
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
||||||
BlackAddedNotification = 1207 //add_black
|
BlackAddedNotification = 1207 //add_black
|
||||||
BlackDeletedNotification = 1208 //remove_black
|
BlackDeletedNotification = 1208 //remove_black
|
||||||
|
FriendInfoUpdatedNotification = 1209
|
||||||
|
|
||||||
ConversationOptChangeNotification = 1300 // change conversation opt
|
ConversationOptChangeNotification = 1300 // change conversation opt
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user