diff options
author | Erik Johnston <erik@matrix.org> | 2024-06-18 14:06:08 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2024-06-18 14:06:08 +0100 |
commit | edc36df4094678448ee92339f048c197e5c9f057 (patch) | |
tree | 1f861eaf774aa072094e2ca143bdfd72bab7a1ba /synapse/visibility.py | |
parent | Merge remote-tracking branch 'origin/release-v1.109' into matrix-org-hotfixes (diff) | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-edc36df4094678448ee92339f048c197e5c9f057.tar.xz |
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/visibility.py')
-rw-r--r-- | synapse/visibility.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/synapse/visibility.py b/synapse/visibility.py index 09a947ef15..128413c8aa 100644 --- a/synapse/visibility.py +++ b/synapse/visibility.py @@ -82,7 +82,6 @@ async def filter_events_for_client( is_peeking: bool = False, always_include_ids: FrozenSet[str] = frozenset(), filter_send_to_client: bool = True, - msc4115_membership_on_events: bool = False, ) -> List[EventBase]: """ Check which events a user is allowed to see. If the user can see the event but its @@ -101,12 +100,10 @@ async def filter_events_for_client( filter_send_to_client: Whether we're checking an event that's going to be sent to a client. This might not always be the case since this function can also be called to check whether a user can see the state at a given point. - msc4115_membership_on_events: Whether to include the requesting user's - membership in the "unsigned" data, per MSC4115. Returns: - The filtered events. If `msc4115_membership_on_events` is true, the `unsigned` - data is annotated with the membership state of `user_id` at each event. + The filtered events. The `unsigned` data is annotated with the membership state + of `user_id` at each event. """ # Filter out events that have been soft failed so that we don't relay them # to clients. @@ -151,7 +148,7 @@ async def filter_events_for_client( filter_send_to_client=filter_send_to_client, sender_ignored=event.sender in ignore_list, always_include_ids=always_include_ids, - retention_policy=retention_policies[room_id], + retention_policy=retention_policies[event.room_id], state=state_after_event, is_peeking=is_peeking, sender_erased=erased_senders.get(event.sender, False), @@ -159,9 +156,6 @@ async def filter_events_for_client( if filtered is None: return None - if not msc4115_membership_on_events: - return filtered - # Annotate the event with the user's membership after the event. # # Normally we just look in `state_after_event`, but if the event is an outlier @@ -186,7 +180,7 @@ async def filter_events_for_client( # Copy the event before updating the unsigned data: this shouldn't be persisted # to the cache! cloned = clone_event(filtered) - cloned.unsigned[EventUnsignedContentFields.MSC4115_MEMBERSHIP] = user_membership + cloned.unsigned[EventUnsignedContentFields.MEMBERSHIP] = user_membership return cloned |