mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-25 12:42:12 +08:00
update update group announcement notication.
This commit is contained in:
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}, ¬ificationFlag)
|
||||
} else {
|
||||
notificationFlag = false
|
||||
g.notification.GroupInfoSetAnnouncementNotification(ctx, &sdkws.GroupInfoSetAnnouncementTips{Group: tips.Group, OpUser: tips.OpUser}, ¬ificationFlag)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if groupNameFlag {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user