update update group announcement notication.

pull/3172/head
Monet Lee 7 months ago
parent fd782b3431
commit efef04f556

@ -69,15 +69,10 @@ func UpdateGroupInfoExMap(ctx context.Context, group *pbgroup.SetGroupInfoExReq)
}
if group.Notification != nil {
// if Notification only contains spaces, set it to empty string
if strings.TrimSpace(group.Notification.Value) != "" {
m["notification"] = group.Notification.Value
notificationFlag = true
} else {
m["notification"] = ""
group.Notification.Value = ""
normalFlag = true
}
notificationFlag = true
group.Notification.Value = strings.TrimSpace(group.Notification.Value) // if Notification only contains spaces, set it to empty string
m["notification"] = group.Notification.Value
m["notification_user_id"] = mcontext.GetOpUserID(ctx)
m["notification_update_time"] = time.Now()
}

@ -1115,8 +1115,9 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI
tips.OpUser = g.groupMemberDB2PB(opMember, 0)
}
if req.Notification != nil {
if notificationFlag {
if notificationFlag {
if req.Notification.Value != "" {
conversation := &pbconv.ConversationReq{
ConversationID: msgprocessor.GetConversationIDBySessionType(constant.ReadGroupChatType, req.GroupID),
ConversationType: constant.ReadGroupChatType,
@ -1136,9 +1137,9 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, &notificationFlag)
} else {
notificationFlag = false
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, &notificationFlag)
}
}
if groupNameFlag {

Loading…
Cancel
Save