summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-10 11:15:02 +0000
committerErik Johnston <erik@matrix.org>2014-11-10 11:15:02 +0000
commit65f846ade09feba129a14b2b9714c2ad51d00f0a (patch)
tree9f7d99af9832ad64df1a649ee9a45c63396ef049 /synapse/api
parentFix invite auth (diff)
downloadsynapse-65f846ade09feba129a14b2b9714c2ad51d00f0a.tar.xz
Notify users about invites.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 077d1ab0bf..3e5d878eed 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -337,15 +337,17 @@ class Auth(object):
         if join_rule_event:
             join_rule = join_rule_event.content.get("join_rule")
             is_public = join_rule == JoinRules.PUBLIC if join_rule else False
+        else:
+            is_public = False
 
-            if event.type == RoomMemberEvent.TYPE:
-                if event.content["membership"] == Membership.JOIN:
-                    if is_public:
-                        auth_events.append(join_rule_event.event_id)
-                elif member_event:
-                    auth_events.append(member_event.event_id)
+        if event.type == RoomMemberEvent.TYPE:
+            e_type = event.content["membership"]
+            if e_type in [Membership.JOIN, Membership.INVITE]:
+                auth_events.append(join_rule_event.event_id)
 
-        if member_event:
+                if member_event and not is_public:
+                    auth_events.append(member_event.event_id)
+        elif member_event:
             if member_event.content["membership"] == Membership.JOIN:
                 auth_events.append(member_event.event_id)