on master help sign in
Fixed group chat permission bug
commita2b4b02c76e5c094422b9924ec920cc627d1d888 authoriko <ilyakooo0@gmail.com> dateSun 5 May 2019, 20:56 (7 years ago) parentd3b5ea4
1 file changed+1−1
denis/src/Data/Query.hs+1−1
denis/src/Data/Query.hs+1−1
@@ -634,7 +634,7 @@ updateGroupChat :: UserId -> GroupChat -> StaticPQ ()
634634updateGroupChat uId (GroupChat gId (Jsonb perms) name) = commitedTransactionallyUpdate $ do
635635 (GroupChat _ (Jsonb perms') _) <- getGroupChatForUser uId gId
636636 let userPerm = fromMaybe minChatPermissions $ M.lookup uId perms'
637− when (isAdmin userPerm) $
637+ unless (isAdmin userPerm) $
638638 lift $ S.throwError $ S.err401
639639 let newPerms = M.adjust (max userPerm) uId perms
640640 void $ manipulateParams updateGroupChatQ (GroupChat gId (Jsonb newPerms) name)