Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode

test-errcode
wangchuxiao 2 years ago
commit 0394ee34e2

@ -156,6 +156,10 @@ func (p *Pusher) Push2SuperGroup(ctx context.Context, groupID string, msg *sdkws
if p.UnmarshalNotificationElem(msg.Content, &tips) != nil {
return err
}
log.ZInfo(ctx, "GroupDismissedNotification userIDs", "groupID", groupID, "userIDs", pushToUserIDs)
if len(config.Config.Manager.AppManagerUid) > 0 {
ctx = mcontext.WithOpUserIDContext(ctx, config.Config.Manager.AppManagerUid[0])
}
if err := p.DismissGroup(ctx, groupID); err != nil {
log.ZError(ctx, "DismissGroup Notification clear members", err, "groupID", groupID)
return err

@ -648,7 +648,11 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI
return e.GroupID
})
resp.GroupInfos = utils.Slice(groups, func(e *relationTb.GroupModel) *sdkws.GroupInfo {
return convert.Db2PbGroupInfo(e, ownerMap[e.GroupID].UserID, groupMemberNumMap[e.GroupID])
var ownerUserID string
if owner, ok := ownerMap[e.GroupID]; ok {
ownerUserID = owner.UserID
}
return convert.Db2PbGroupInfo(e, ownerUserID, groupMemberNumMap[e.GroupID])
})
return resp, nil
}
@ -1051,10 +1055,8 @@ func (s *groupServer) GetUserReqApplicationList(ctx context.Context, req *pbGrou
}
func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGroupReq) (*pbGroup.DismissGroupResp, error) {
defer log.ZInfo(ctx, "DismissGroup.return")
resp := &pbGroup.DismissGroupResp{}
if err := s.CheckGroupAdmin(ctx, req.GroupID); err != nil {
return nil, err
}
if !tokenverify.IsAppManagerUid(ctx) {
user, err := s.GroupDatabase.TakeGroupOwner(ctx, req.GroupID)
if err != nil {
@ -1079,7 +1081,9 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
return nil, err
}
} else {
s.Notification.GroupDismissedNotification(ctx, req)
if !req.DeleteMember {
s.Notification.GroupDismissedNotification(ctx, req)
}
}
return resp, nil
}

Loading…
Cancel
Save