mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
commit
0b5838c79b
@ -140,7 +140,10 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
|||||||
if req.OwnerUserID == "" {
|
if req.OwnerUserID == "" {
|
||||||
return nil, errs.ErrArgs.Wrap("no group owner")
|
return nil, errs.ErrArgs.Wrap("no group owner")
|
||||||
}
|
}
|
||||||
userIDs := append(append(req.InitMembers, req.AdminUserIDs...), req.OwnerUserID, mcontext.GetOpUserID(ctx))
|
userIDs := append(append(req.InitMembers, req.AdminUserIDs...), req.OwnerUserID)
|
||||||
|
if opUserID := mcontext.GetOpUserID(ctx); !utils.Contain(opUserID, userIDs...) {
|
||||||
|
userIDs = append(userIDs, opUserID)
|
||||||
|
}
|
||||||
if utils.Duplicate(userIDs) {
|
if utils.Duplicate(userIDs) {
|
||||||
return nil, errs.ErrArgs.Wrap("group member repeated")
|
return nil, errs.ErrArgs.Wrap("group member repeated")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user