ios: groups miscellaneous (#843)

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
JRoberts
2022-07-27 11:16:07 +04:00
committed by GitHub
parent a4aaf36774
commit aa7e377bce
12 changed files with 265 additions and 144 deletions
+2 -1
View File
@@ -745,7 +745,8 @@ processChatCommand = \case
Nothing -> throwChatError CEGroupMemberNotFound
Just m@GroupMember {memberId = mId, memberRole = mRole, memberStatus = mStatus, memberProfile} -> do
let userRole = memberRole (membership :: GroupMember)
when (userRole < GRAdmin || userRole < mRole) $ throwChatError CEGroupUserRole
canRemove = userRole >= GRAdmin && userRole >= mRole
unless canRemove $ throwChatError CEGroupUserRole
withChatLock . procCmd $ do
when (mStatus /= GSMemInvited) $ do
msg <- sendGroupMessage gInfo members $ XGrpMemDel mId