Merge ifs

pull/5760/head
Brendan Abolivier 2019-07-25 10:15:44 +02:00
parent aea03c9d73
commit 2526b79ce6
No known key found for this signature in database
GPG Key ID: 1E015C145F1916CD
1 changed files with 4 additions and 5 deletions

View File

@ -128,12 +128,11 @@ class RoomAccessRules(object):
# rule, the access rule must be "restricted"). We don't need to check that if
# there's no access rule provided, as in this case the access rule will
# default to "restricted", with which any join rule is allowed.
if join_rule == JoinRules.PUBLIC and access_rule != ACCESS_RULE_RESTRICTED:
raise SynapseError(400, "Invalid access rule")
if (
preset == RoomCreationPreset.PUBLIC_CHAT
and access_rule != ACCESS_RULE_RESTRICTED
(
join_rule == JoinRules.PUBLIC
or preset == RoomCreationPreset.PUBLIC_CHAT
) and access_rule != ACCESS_RULE_RESTRICTED
):
raise SynapseError(400, "Invalid access rule")
else: