From e0c70742a8f4c16758c25d372e75f0566fdc70b4 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Fri, 19 May 2023 20:13:04 +0800 Subject: [PATCH] DismissGroup --- pkg/rpcclient/notification/group.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/rpcclient/notification/group.go b/pkg/rpcclient/notification/group.go index 054ed744f..fc94c2fc1 100644 --- a/pkg/rpcclient/notification/group.go +++ b/pkg/rpcclient/notification/group.go @@ -555,11 +555,19 @@ func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context if err != nil { return err } - user, err := g.getGroupMember(ctx, req.GroupID, mcontext.GetOpUserID(ctx)) + users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)}) if err != nil { return err } - tips := &sdkws.GroupDismissedTips{Group: group, OpUser: user} + tips := &sdkws.GroupDismissedTips{Group: group} + if len(users) > 0 { + tips.OpUser = users[0] + } else { + tips.OpUser = &sdkws.GroupMemberFullInfo{ + GroupID: group.GroupID, + UserID: mcontext.GetOpUserID(ctx), + } + } return g.msgClient.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupDismissedNotification, tips) }