Skip to content

Commit 32d1d1c

Browse files
committed
Assert state_after_event is not None for call invites
1 parent 8c84264 commit 32d1d1c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

synapse/visibility.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,13 @@ def allowed(event: EventBase) -> EventBase | None:
196196
# Filter out call invites in public rooms, as this would potentially
197197
# ring a lot of users.
198198
if (
199-
state_after_event is not None
199+
event.type == EventTypes.CallInvite
200200
and not event.is_state()
201-
and event.type == EventTypes.CallInvite
202201
):
202+
# `state_after_event` should only be None if the event is an outlier,
203+
# and call invites should not be outliers.
204+
assert state_after_event is not None
205+
203206
room_join_rules = state_after_event.get((EventTypes.JoinRules, ""))
204207
if (
205208
room_join_rules is not None

0 commit comments

Comments
 (0)