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.
This commit is contained in:
Daniel Wagner-Hall 2015-10-20 11:58:58 +01:00
parent 9261ef3a15
commit 137fafce4e
8 changed files with 353 additions and 93 deletions

View file

@ -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,