diff --git a/config/config.yaml b/config/config.yaml index 573c3bfeb..286954b7d 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -240,7 +240,7 @@ iospush: callback: # callback url 需要自行更换callback url - callbackUrl: "http://127.0.0.1:8080/callback" + callbackUrl: "http://127.0.0.1:10008/callback" # 开启关闭操作前后回调的配置 callbackBeforeSendSingleMsg: enable: false # 回调是否启用 diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 8200aa29f..e42d73cc3 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -1339,6 +1339,14 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr return nil, err } for _, member := range req.Members { + if member.RoleLevel != nil { + switch member.RoleLevel.Value { + case constant.GroupAdmin: + s.Notification.GroupMemberSetToAdminNotification(ctx, member.GroupID, member.UserID) + case constant.GroupOrdinaryUsers: + s.Notification.GroupMemberSetToOrdinaryUserNotification(ctx, member.GroupID, member.UserID) + } + } s.Notification.GroupMemberInfoSetNotification(ctx, member.GroupID, member.UserID) } return resp, nil diff --git a/pkg/rpcclient/notification/group.go b/pkg/rpcclient/notification/group.go index 2de52f724..11b7dd748 100644 --- a/pkg/rpcclient/notification/group.go +++ b/pkg/rpcclient/notification/group.go @@ -673,10 +673,10 @@ func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Con return err } tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]} - return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips) } -func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.Context, groupID, groupMemberUserID string, notificationType int32) (err error) { +func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) { defer log.ZDebug(ctx, "return") defer func() { if err != nil { @@ -692,7 +692,26 @@ func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context. return err } tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]} - return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips) + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips) +} + +func (g *GroupNotificationSender) GroupMemberSetToOrdinaryUserNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) { + defer log.ZDebug(ctx, "return") + defer func() { + if err != nil { + log.ZError(ctx, utils.GetFuncName(1)+" failed", err) + } + }() + group, err := g.getGroupInfo(ctx, groupID) + if err != nil { + return err + } + user, err := g.getGroupMemberMap(ctx, groupID, []string{mcontext.GetOpUserID(ctx), groupMemberUserID}) + if err != nil { + return err + } + tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]} + return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips) } func (g *GroupNotificationSender) MemberEnterDirectlyNotification(ctx context.Context, groupID string, entrantUserID string) (err error) {