|
|
@ -160,6 +160,14 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
|
|
|
|
tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips
|
|
|
|
tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips
|
|
|
|
case constant.GroupDismissedNotification:
|
|
|
|
case constant.GroupDismissedNotification:
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips
|
|
|
|
|
|
|
|
case constant.GroupMutedNotification:
|
|
|
|
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupMuted.DefaultTips.Tips
|
|
|
|
|
|
|
|
case constant.GroupCancelMutedNotification:
|
|
|
|
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupCancelMuted.DefaultTips.Tips
|
|
|
|
|
|
|
|
case constant.GroupMemberMutedNotification:
|
|
|
|
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupMemberMuted.DefaultTips.Tips
|
|
|
|
|
|
|
|
case constant.GroupMemberCancelMutedNotification:
|
|
|
|
|
|
|
|
tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
log.Error(operationID, "contentType failed ", contentType)
|
|
|
|
log.Error(operationID, "contentType failed ", contentType)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -227,6 +235,71 @@ func GroupInfoSetNotification(operationID, opUserID, groupID string) {
|
|
|
|
groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID)
|
|
|
|
groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GroupMutedNotification(operationID, opUserID, groupID string) {
|
|
|
|
|
|
|
|
tips := open_im_sdk.GroupMutedTips{Group: &open_im_sdk.GroupInfo{},
|
|
|
|
|
|
|
|
OpUser: &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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupNotification(constant.GroupMutedNotification, &tips, opUserID, groupID, "", operationID)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GroupCancelMutedNotification(operationID, opUserID, groupID string) {
|
|
|
|
|
|
|
|
tips := open_im_sdk.GroupCancelMutedTips{Group: &open_im_sdk.GroupInfo{},
|
|
|
|
|
|
|
|
OpUser: &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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupNotification(constant.GroupCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GroupMemberMutedNotification(operationID, opUserID, groupID, groupMemberUserID string, mutedSeconds uint32) {
|
|
|
|
|
|
|
|
tips := open_im_sdk.GroupMemberMutedTips{Group: &open_im_sdk.GroupInfo{},
|
|
|
|
|
|
|
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}}
|
|
|
|
|
|
|
|
tips.MutedSeconds = mutedSeconds
|
|
|
|
|
|
|
|
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.MutedUser); err != nil {
|
|
|
|
|
|
|
|
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupNotification(constant.GroupMemberMutedNotification, &tips, opUserID, groupID, "", operationID)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) {
|
|
|
|
|
|
|
|
tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{},
|
|
|
|
|
|
|
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &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.MutedUser); err != nil {
|
|
|
|
|
|
|
|
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupNotification(constant.GroupMemberCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//message ReceiveJoinApplicationTips{
|
|
|
|
//message ReceiveJoinApplicationTips{
|
|
|
|
// GroupInfo Group = 1;
|
|
|
|
// GroupInfo Group = 1;
|
|
|
|
// PublicUserInfo Applicant = 2;
|
|
|
|
// PublicUserInfo Applicant = 2;
|
|
|
|