diff options
author | Daniel Wagner-Hall <daniel@matrix.org> | 2015-10-20 11:58:58 +0100 |
---|---|---|
committer | Daniel Wagner-Hall <daniel@matrix.org> | 2015-10-20 11:58:58 +0100 |
commit | 137fafce4ee06e76b05d37807611e10055059f62 (patch) | |
tree | e91bb8c10daa5ac1a3d2675d40e0f6ee5ea73508 /synapse/api | |
parent | Merge pull request #312 from matrix-org/daniel/3pidinvites (diff) | |
download | synapse-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')
-rw-r--r-- | synapse/api/auth.py | 6 |
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, |