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.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.py')
-rw-r--r-- | synapse/handlers/federation.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index be5099b507..0386d0a07b 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -54,6 +54,7 @@ from synapse.replication.http.federation import ( ReplicationStoreRoomOnOutlierMembershipRestServlet, ) from synapse.storage.databases.main.events_worker import EventRedactBehaviour +from synapse.storage.state import StateFilter from synapse.types import JsonDict, StateMap, get_domain_from_id from synapse.util.async_helpers import Linearizer from synapse.util.retryutils import NotRetryingDestination @@ -1259,7 +1260,9 @@ class FederationHandler: event.content["third_party_invite"]["signed"]["token"], ) original_invite = None - prev_state_ids = await context.get_prev_state_ids() + prev_state_ids = await context.get_prev_state_ids( + StateFilter.from_types([(EventTypes.ThirdPartyInvite, None)]) + ) original_invite_id = prev_state_ids.get(key) if original_invite_id: original_invite = await self.store.get_event( @@ -1308,7 +1311,9 @@ class FederationHandler: signed = event.content["third_party_invite"]["signed"] token = signed["token"] - prev_state_ids = await context.get_prev_state_ids() + prev_state_ids = await context.get_prev_state_ids( + StateFilter.from_types([(EventTypes.ThirdPartyInvite, None)]) + ) invite_event_id = prev_state_ids.get((EventTypes.ThirdPartyInvite, token)) invite_event = None |