summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-06-18 11:28:33 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-06-18 11:28:33 +0100
commitf7339d42ee572f892c12501896a477c8f927b94e (patch)
tree885e2d31d50794ed4a904647ac9d6df73ef9afea
parentDocstrings (diff)
downloadsynapse-f7339d42ee572f892c12501896a477c8f927b94e.tar.xz
Fixes
-rw-r--r--synapse/third_party_rules/access_rules.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/third_party_rules/access_rules.py b/synapse/third_party_rules/access_rules.py
index a8b3ed9458..07a1649584 100644
--- a/synapse/third_party_rules/access_rules.py
+++ b/synapse/third_party_rules/access_rules.py
@@ -105,6 +105,9 @@ class RoomAccessRules(object):
         # If there's no rules event in the initial state, create one with the default
         # setting.
         if not rules_in_initial_state:
+            if not config.get("initial_state"):
+                config["initial_state"] = []
+
             config["initial_state"].append({
                 "type": ACCESS_RULES_TYPE,
                 "state_key": "",
@@ -246,6 +249,8 @@ class RoomAccessRules(object):
         """
         # "restricted" currently means that users can only invite users if their server is
         # included in a limited list of domains.
+        if event.type != EventTypes.Member and event.type != EventTypes.ThirdPartyInvite:
+            return True
         invitee_domain = DomainRuleChecker._get_domain_from_id(event.state_key)
         return invitee_domain not in self.domains_forbidden_when_restricted