GroupDismissedNotification

test-errcode
withchao 1 year ago
parent 97aa17af6c
commit f8bacd1dc2

@ -1111,17 +1111,16 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
} else { } else {
if !req.DeleteMember { if !req.DeleteMember {
//s.Notification.GroupDismissedNotification(ctx, req) //s.Notification.GroupDismissedNotification(ctx, req)
tips := &sdkws.GroupInfoSetTips{ tips := &sdkws.GroupDismissedTips{
Group: s.groupDB2PB(group, owner.UserID, uint32(len(userIDs))), Group: s.groupDB2PB(group, owner.UserID, uint32(len(userIDs))),
MuteTime: 0, OpUser: &sdkws.GroupMemberFullInfo{},
OpUser: &sdkws.GroupMemberFullInfo{},
} }
if mcontext.GetOpUserID(ctx) == owner.UserID { if mcontext.GetOpUserID(ctx) == owner.UserID {
tips.OpUser = s.groupMemberDB2PB(owner, 0) tips.OpUser = s.groupMemberDB2PB(owner, 0)
} else { } else {
tips.OpUser = &sdkws.GroupMemberFullInfo{UserID: mcontext.GetOpUserID(ctx)} tips.OpUser = &sdkws.GroupMemberFullInfo{UserID: mcontext.GetOpUserID(ctx)}
} }
s.Notification.GroupInfoSetNotification(ctx, tips) s.Notification.GroupDismissedNotification(ctx, tips)
} }
} }
return resp, nil return resp, nil

@ -542,31 +542,32 @@ func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, r
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberEnterNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberEnterNotification, tips)
} }
func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, req *pbGroup.DismissGroupReq) (err error) { func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, tips *sdkws.GroupDismissedTips) (err error) {
defer log.ZDebug(ctx, "return") //defer log.ZDebug(ctx, "return")
defer func() { //defer func() {
if err != nil { // if err != nil {
log.ZError(ctx, utils.GetFuncName(1)+" failed", err) // log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
} // }
}() //}()
group, err := g.getGroupInfo(ctx, req.GroupID) //group, err := g.getGroupInfo(ctx, req.GroupID)
if err != nil { //if err != nil {
return err // return err
} //}
users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)}) //users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)})
if err != nil { //if err != nil {
return err // return err
} //}
tips := &sdkws.GroupDismissedTips{Group: group} //tips := &sdkws.GroupDismissedTips{Group: group}
if len(users) > 0 { //if len(users) > 0 {
tips.OpUser = users[0] // tips.OpUser = users[0]
} else { //} else {
tips.OpUser = &sdkws.GroupMemberFullInfo{ // tips.OpUser = &sdkws.GroupMemberFullInfo{
GroupID: group.GroupID, // GroupID: group.GroupID,
UserID: mcontext.GetOpUserID(ctx), // UserID: mcontext.GetOpUserID(ctx),
} // }
} //}
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupDismissedNotification, tips) //return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupDismissedNotification, tips)
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips)
} }
func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) { func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) {

Loading…
Cancel
Save