Skip to content

Commit

Permalink
Fix rejection of invites not reaching sync
Browse files Browse the repository at this point in the history
Always allow the user to see their own leave events, otherwise
they won't see the event if they reject an invite for a room whose
history visibility is set such that they cannot see events before
joining.
  • Loading branch information
dbkr committed Mar 23, 2017
1 parent 6af0096 commit e1f1784
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions synapse/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ def allowed(event, user_id, is_peeking, ignore_list):
if prev_membership not in MEMBERSHIP_PRIORITY:
prev_membership = "leave"

# Always allow the user to see their own leave events, otherwise
# they won't see the room disappear if they reject the invite
if membership == "leave" and (
prev_membership == "join" or prev_membership == "invite"
):
return True

new_priority = MEMBERSHIP_PRIORITY.index(membership)
old_priority = MEMBERSHIP_PRIORITY.index(prev_membership)
if old_priority < new_priority:
Expand Down

0 comments on commit e1f1784

Please sign in to comment.