pull/236/head
wangchuxiao 3 years ago
parent 4f1bd4e509
commit 276328e0fd

@ -481,6 +481,30 @@ notification:
defaultTips: defaultTips:
tips: "group member info set" tips: "group member info set"
groupMemberSetToOrdinaryUser:
conversation:
reliabilityLevel: 3
unreadCount: false
offlinePush:
switch: false
title: "groupMemberSetToOrdinaryUser title"
desc: "groupMemberSetToOrdinaryUser desc"
ext: "groupMemberSetToOrdinaryUser ext"
defaultTips:
tips: "was set to ordinaryUser"
groupMemberSetToAdmin:
conversation:
reliabilityLevel: 3
unreadCount: false
offlinePush:
switch: false
title: "groupMemberSetToAdmin title"
desc: "groupMemberSetToAdmin desc"
ext: "groupMemberSetToAdmin ext"
defaultTips:
tips: "was set to admin"
#############################organization#################################
organizationChanged: organizationChanged:
conversation: conversation:

@ -266,7 +266,7 @@ func ManagementBatchSendMsg(c *gin.Context) {
continue continue
} }
if rpcResp.ErrCode != 0 { if rpcResp.ErrCode != 0 {
log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData) log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData, rpcResp)
resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID)
continue continue
} }

@ -1648,7 +1648,16 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + ":" + err.Error() resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + ":" + err.Error()
return resp, nil return resp, nil
} }
chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) if req.RoleLevel != nil {
switch req.RoleLevel.Value {
case constant.GroupOrdinaryUsers:
chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToOrdinaryUserNotification)
case constant.GroupAdmin, constant.GroupOwner:
chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToAdminNotification)
}
} else {
chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID)
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil return resp, nil
} }

@ -49,12 +49,6 @@ func ConversationSetPrivateNotification(operationID, sendID, recvID string, isPr
} }
var tips open_im_sdk.TipsComm var tips open_im_sdk.TipsComm
var tipsMsg string var tipsMsg string
//var senderName string
//senderName, err := im_mysql_model.GetUserNameByUserID(sendID)
//if err != nil {
// log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
// senderName = sendID
//}
if isPrivateChat == true { if isPrivateChat == true {
tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips
} else { } else {

@ -170,7 +170,10 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips
case constant.GroupMemberInfoSetNotification: case constant.GroupMemberInfoSetNotification:
tips.DefaultTips = toNickname + "" + cn.GroupMemberInfoSet.DefaultTips.Tips tips.DefaultTips = toNickname + "" + cn.GroupMemberInfoSet.DefaultTips.Tips
case constant.GroupMemberSetToAdminNotification:
tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToAdmin.DefaultTips.Tips
case constant.GroupMemberSetToOrdinaryUserNotification:
tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToOrdinary.DefaultTips.Tips
default: default:
log.Error(operationID, "contentType failed ", contentType) log.Error(operationID, "contentType failed ", contentType)
return return
@ -311,6 +314,28 @@ func GroupMemberInfoSetNotification(operationID, opUserID, groupID, groupMemberU
groupNotification(constant.GroupMemberInfoSetNotification, &tips, opUserID, groupID, "", operationID) groupNotification(constant.GroupMemberInfoSetNotification, &tips, opUserID, groupID, "", operationID)
} }
func GroupMemberRoleLevelChangeNotification(operationID, opUserID, groupID, groupMemberUserID string, notificationType int32) {
if notificationType != constant.GroupMemberSetToAdminNotification || notificationType != constant.GroupOrdinaryUsers {
log.NewError(operationID, utils.GetSelfFuncName(), "invalid notificationType: ", notificationType)
return
}
tips := open_im_sdk.GroupMemberInfoSetTips{Group: &open_im_sdk.GroupInfo{},
OpUser: &open_im_sdk.GroupMemberFullInfo{}, ChangedUser: &open_im_sdk.GroupMemberFullInfo{}}
if err := setGroupInfo(groupID, tips.Group); err != nil {
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
return
}
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
return
}
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.ChangedUser); err != nil {
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
return
}
groupNotification(notificationType, &tips, opUserID, groupID, "", operationID)
}
func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) { func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) {
tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{}, tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{},
OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}} OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}}

@ -51,6 +51,9 @@ type MsgCallBackResp struct {
func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) {
if data.MsgData.SessionType == constant.SingleChatType { if data.MsgData.SessionType == constant.SingleChatType {
if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) {
return true, 0, ""
}
log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify)
reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)

@ -339,6 +339,16 @@ type config struct {
OfflinePush POfflinePush `yaml:"offlinePush"` OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"` DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"groupMemberInfoSet"` } `yaml:"groupMemberInfoSet"`
GroupMemberSetToAdmin struct {
Conversation PConversation `yaml:"conversation"`
OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"groupMemberSetToAdmin"`
GroupMemberSetToOrdinary struct {
Conversation PConversation `yaml:"conversation"`
OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"groupMemberSetToOrdinaryUser"`
OrganizationChanged struct { OrganizationChanged struct {
Conversation PConversation `yaml:"conversation"` Conversation PConversation `yaml:"conversation"`
OfflinePush POfflinePush `yaml:"offlinePush"` OfflinePush POfflinePush `yaml:"offlinePush"`

@ -67,22 +67,24 @@ const (
GroupNotificationBegin = 1500 GroupNotificationBegin = 1500
GroupCreatedNotification = 1501 GroupCreatedNotification = 1501
GroupInfoSetNotification = 1502 GroupInfoSetNotification = 1502
JoinGroupApplicationNotification = 1503 JoinGroupApplicationNotification = 1503
MemberQuitNotification = 1504 MemberQuitNotification = 1504
GroupApplicationAcceptedNotification = 1505 GroupApplicationAcceptedNotification = 1505
GroupApplicationRejectedNotification = 1506 GroupApplicationRejectedNotification = 1506
GroupOwnerTransferredNotification = 1507 GroupOwnerTransferredNotification = 1507
MemberKickedNotification = 1508 MemberKickedNotification = 1508
MemberInvitedNotification = 1509 MemberInvitedNotification = 1509
MemberEnterNotification = 1510 MemberEnterNotification = 1510
GroupDismissedNotification = 1511 GroupDismissedNotification = 1511
GroupMemberMutedNotification = 1512 GroupMemberMutedNotification = 1512
GroupMemberCancelMutedNotification = 1513 GroupMemberCancelMutedNotification = 1513
GroupMutedNotification = 1514 GroupMutedNotification = 1514
GroupCancelMutedNotification = 1515 GroupCancelMutedNotification = 1515
GroupMemberInfoSetNotification = 1516 GroupMemberInfoSetNotification = 1516
GroupMemberSetToAdminNotification = 1517
GroupMemberSetToOrdinaryUserNotification = 1518
SignalingNotificationBegin = 1600 SignalingNotificationBegin = 1600
SignalingNotification = 1601 SignalingNotification = 1601

Loading…
Cancel
Save