summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-10-20 11:58:58 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-10-20 11:58:58 +0100
commit137fafce4ee06e76b05d37807611e10055059f62 (patch)
treee91bb8c10daa5ac1a3d2675d40e0f6ee5ea73508 /synapse/api/auth.py
parentMerge pull request #312 from matrix-org/daniel/3pidinvites (diff)
downloadsynapse-137fafce4ee06e76b05d37807611e10055059f62.tar.xz
Allow rejecting invites
This is done by using the same /leave flow as you would use if you had
already accepted the invite and wanted to leave.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index cf19eda4e9..494c8ac3d4 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -308,7 +308,11 @@ class Auth(object):
         )
 
         if Membership.JOIN != membership:
-            # JOIN is the only action you can perform if you're not in the room
+            if (caller_invited
+                    and Membership.LEAVE == membership
+                    and target_user_id == event.user_id):
+                return True
+
             if not caller_in_room:  # caller isn't joined
                 raise AuthError(
                     403,