mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
commit
27f0dc282b
@ -1111,17 +1111,16 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
|
||||
} else {
|
||||
if !req.DeleteMember {
|
||||
//s.Notification.GroupDismissedNotification(ctx, req)
|
||||
tips := &sdkws.GroupInfoSetTips{
|
||||
Group: s.groupDB2PB(group, owner.UserID, uint32(len(userIDs))),
|
||||
MuteTime: 0,
|
||||
OpUser: &sdkws.GroupMemberFullInfo{},
|
||||
tips := &sdkws.GroupDismissedTips{
|
||||
Group: s.groupDB2PB(group, owner.UserID, uint32(len(userIDs))),
|
||||
OpUser: &sdkws.GroupMemberFullInfo{},
|
||||
}
|
||||
if mcontext.GetOpUserID(ctx) == owner.UserID {
|
||||
tips.OpUser = s.groupMemberDB2PB(owner, 0)
|
||||
} else {
|
||||
tips.OpUser = &sdkws.GroupMemberFullInfo{UserID: mcontext.GetOpUserID(ctx)}
|
||||
}
|
||||
s.Notification.GroupInfoSetNotification(ctx, tips)
|
||||
s.Notification.GroupDismissedNotification(ctx, tips)
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, req *pbGroup.DismissGroupReq) (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, req.GroupID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
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.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupDismissedNotification, tips)
|
||||
func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, tips *sdkws.GroupDismissedTips) (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, req.GroupID)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)})
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//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.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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user