diff options
author | Shay <hillerys@element.io> | 2022-05-20 01:54:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 09:54:12 +0100 |
commit | 71e8afe34d2103c5ccc9f2d1c99587d14b2acc56 (patch) | |
tree | 38ca83b911323cd5312165467e2b8bf077987d2a /synapse/handlers/federation_event.py | |
parent | Fix `RetryDestinationLimiter` re-starting finished log contexts (#12803) (diff) | |
download | synapse-71e8afe34d2103c5ccc9f2d1c99587d14b2acc56.tar.xz |
Update EventContext `get_current_event_ids` and `get_prev_event_ids` to accept state filters and update calls where possible (#12791)
Diffstat (limited to 'synapse/handlers/federation_event.py')
-rw-r--r-- | synapse/handlers/federation_event.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py index 761caa04b7..05c122f224 100644 --- a/synapse/handlers/federation_event.py +++ b/synapse/handlers/federation_event.py @@ -30,6 +30,7 @@ from typing import ( from prometheus_client import Counter +from synapse import event_auth from synapse.api.constants import ( EventContentFields, EventTypes, @@ -63,6 +64,7 @@ from synapse.replication.http.federation import ( ) from synapse.state import StateResolutionStore from synapse.storage.databases.main.events_worker import EventRedactBehaviour +from synapse.storage.state import StateFilter from synapse.types import ( PersistedEventPosition, RoomStreamToken, @@ -1500,7 +1502,11 @@ class FederationEventHandler: return context # now check auth against what we think the auth events *should* be. - prev_state_ids = await context.get_prev_state_ids() + event_types = event_auth.auth_types_for_event(event.room_version, event) + prev_state_ids = await context.get_prev_state_ids( + StateFilter.from_types(event_types) + ) + auth_events_ids = self._event_auth_handler.compute_auth_events( event, prev_state_ids, for_verification=True ) |