From 9f2ebcdcdd685757f8883409add8682a4aa7e94a Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Fri, 28 Feb 2025 16:39:59 +0800 Subject: [PATCH] fix: setGroupInfoEx uncorrect call. --- internal/rpc/group/group.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 8ad4a949f..199480d5d 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -1086,6 +1086,11 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI return nil, err } + // if Notification only contains spaces, set it to empty string + if strings.TrimSpace(req.Notification.Value) == "" { + req.Notification.Value = "" + } + updatedData, err := UpdateGroupInfoExMap(ctx, req) if len(updatedData) == 0 { return &pbgroup.SetGroupInfoExResp{}, nil @@ -1114,12 +1119,13 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI tips.OpUser = g.groupMemberDB2PB(opMember, 0) } + // num is len of updatedData, use for the different type of notification num := len(updatedData) if req.Notification != nil { - num -= 3 - if req.Notification.Value != "" { + num -= 3 + func() { conversation := &pbconv.ConversationReq{ ConversationID: msgprocessor.GetConversationIDBySessionType(constant.ReadGroupChatType, req.GroupID), @@ -1148,6 +1154,7 @@ func (g *groupServer) SetGroupInfoEx(ctx context.Context, req *pbgroup.SetGroupI g.notification.GroupInfoSetNameNotification(ctx, &sdkws.GroupInfoSetNameTips{Group: tips.Group, OpUser: tips.OpUser}) } + // if num > 0, send the normal notification if num > 0 { g.notification.GroupInfoSetNotification(ctx, tips) }