|
|
|
@ -292,10 +292,11 @@ func (g *groupServer) CreateGroup(ctx context.Context, req *pbgroup.CreateGroupR
|
|
|
|
|
g.notification.GroupCreatedNotification(ctx, tips, req.SendMessage)
|
|
|
|
|
|
|
|
|
|
if req.GroupInfo.Notification != "" {
|
|
|
|
|
notificationFlag := true
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{
|
|
|
|
|
Group: tips.Group,
|
|
|
|
|
OpUser: tips.OpUser,
|
|
|
|
|
})
|
|
|
|
|
}, ¬ificationFlag)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reqCallBackAfter := &pbgroup.CreateGroupReq{
|
|
|
|
@ -1036,7 +1037,8 @@ func (g *groupServer) SetGroupInfo(ctx context.Context, req *pbgroup.SetGroupInf
|
|
|
|
|
log.ZWarn(ctx, "SetConversations", err, "UserIDs", resp.UserIDs, "conversation", conversation)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser})
|
|
|
|
|
notficationFlag := true
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, ¬ficationFlag)
|
|
|
|
|
}
|
|
|
|
|
if req.GroupInfoForSet.GroupName != "" {
|
|
|
|
|
num--
|
|
|
|
@ -1097,7 +1099,7 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatedData, err := UpdateGroupInfoExMap(ctx, req)
|
|
|
|
|
updatedData, normalFlag, groupNameFlag, notificationFlag, err := UpdateGroupInfoExMap(ctx, req)
|
|
|
|
|
if len(updatedData) == 0 {
|
|
|
|
|
return &pbgroup.SetGroupInfoExResp{}, nil
|
|
|
|
|
}
|
|
|
|
@ -1125,14 +1127,9 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI
|
|
|
|
|
tips.OpUser = g.groupMemberDB2PB(opMember, 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
num := len(updatedData)
|
|
|
|
|
|
|
|
|
|
if req.Notification != nil {
|
|
|
|
|
num -= 3
|
|
|
|
|
|
|
|
|
|
if notificationFlag {
|
|
|
|
|
if req.Notification.Value != "" {
|
|
|
|
|
func() {
|
|
|
|
|
conversation := &pbconversation.ConversationReq{
|
|
|
|
|
conversation := &pbconv.ConversationReq{
|
|
|
|
|
ConversationID: msgprocessor.GetConversationIDBySessionType(constant.ReadGroupChatType, req.GroupID),
|
|
|
|
|
ConversationType: constant.ReadGroupChatType,
|
|
|
|
|
GroupID: req.GroupID,
|
|
|
|
@ -1141,25 +1138,27 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI
|
|
|
|
|
resp, err := g.GetGroupMemberUserIDs(ctx, &pbgroup.GetGroupMemberUserIDsReq{GroupID: req.GroupID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.ZWarn(ctx, "GetGroupMemberIDs is failed.", err)
|
|
|
|
|
return
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conversation.GroupAtType = &wrapperspb.Int32Value{Value: constant.GroupNotification}
|
|
|
|
|
if err := g.conversationClient.SetConversations(ctx, resp.UserIDs, conversation); err != nil {
|
|
|
|
|
log.ZWarn(ctx, "SetConversations", err, "UserIDs", resp.UserIDs, "conversation", conversation)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser})
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, ¬ificationFlag)
|
|
|
|
|
} else {
|
|
|
|
|
notificationFlag = false
|
|
|
|
|
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, ¬ificationFlag)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if req.GroupName != nil {
|
|
|
|
|
num--
|
|
|
|
|
if groupNameFlag {
|
|
|
|
|
g.notification.GroupInfoSetNameNotification(ctx, &sdkws.GroupInfoSetNameTips{Group: tips.Group, OpUser: tips.OpUser})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if num > 0 {
|
|
|
|
|
// if updatedData > 0, send the normal notification
|
|
|
|
|
if normalFlag {
|
|
|
|
|
g.notification.GroupInfoSetNotification(ctx, tips)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|