Skip to content

Commit

Permalink
fixup! Return membership on each event returned to the client
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Apr 22, 2024
1 parent cb09fc5 commit e17a56c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synapse/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ def allowed(event: EventBase) -> Optional[EventBase]:
# we won't have such a state. The only outliers that are returned here are the
# user's own membership event, so we can just inspect that.

user_membership_event: Optional[EventBase]
if event.type == EventTypes.Member and event.state_key == user_id:
user_membership_event = event
elif state_after_event is not None:
user_membership_event = state_after_event[(EventTypes.Member, user_id)]
user_membership_event = state_after_event.get((EventTypes.Member, user_id))
else:
# unreachable!
raise Exception("Missing state for event that is not user's own membership")
Expand Down

0 comments on commit e17a56c

Please sign in to comment.