Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e17a56c

Browse files
committedApr 22, 2024·
fixup! Return membership on each event returned to the client
1 parent cb09fc5 commit e17a56c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎synapse/visibility.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,11 @@ def allowed(event: EventBase) -> Optional[EventBase]:
168168
# we won't have such a state. The only outliers that are returned here are the
169169
# user's own membership event, so we can just inspect that.
170170

171+
user_membership_event: Optional[EventBase]
171172
if event.type == EventTypes.Member and event.state_key == user_id:
172173
user_membership_event = event
173174
elif state_after_event is not None:
174-
user_membership_event = state_after_event[(EventTypes.Member, user_id)]
175+
user_membership_event = state_after_event.get((EventTypes.Member, user_id))
175176
else:
176177
# unreachable!
177178
raise Exception("Missing state for event that is not user's own membership")

0 commit comments

Comments
 (0)
Please sign in to comment.