mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 18:44:51 -04:00
Update EventContext get_current_event_ids
and get_prev_event_ids
to accept state filters and update calls where possible (#12791)
This commit is contained in:
parent
2be5a2b07b
commit
71e8afe34d
10 changed files with 65 additions and 18 deletions
|
@ -634,16 +634,19 @@ class StateGroupStorage:
|
|||
|
||||
return group_to_state
|
||||
|
||||
async def get_state_ids_for_group(self, state_group: int) -> StateMap[str]:
|
||||
async def get_state_ids_for_group(
|
||||
self, state_group: int, state_filter: Optional[StateFilter] = None
|
||||
) -> StateMap[str]:
|
||||
"""Get the event IDs of all the state in the given state group
|
||||
|
||||
Args:
|
||||
state_group: A state group for which we want to get the state IDs.
|
||||
state_filter: specifies the type of state event to fetch from DB, example: EventTypes.JoinRules
|
||||
|
||||
Returns:
|
||||
Resolves to a map of (type, state_key) -> event_id
|
||||
"""
|
||||
group_to_state = await self.get_state_for_groups((state_group,))
|
||||
group_to_state = await self.get_state_for_groups((state_group,), state_filter)
|
||||
|
||||
return group_to_state[state_group]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue