Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2835 from matrix-org/rav/remove_event_type_param
Browse files Browse the repository at this point in the history
Remove unused "event_type" param on state.get_current_state_ids
  • Loading branch information
richvdh authored Jan 31, 2018
2 parents 518a745 + adfc0c9 commit ad48dfe
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions synapse/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,27 @@ def get_current_state(self, room_id, event_type=None, state_key="",
defer.returnValue(state)

@defer.inlineCallbacks
def get_current_state_ids(self, room_id, event_type=None, state_key="",
latest_event_ids=None):
def get_current_state_ids(self, room_id, latest_event_ids=None):
"""Get the current state, or the state at a set of events, for a room
Args:
room_id (str):
latest_event_ids (iterable[str]|None): if given, the forward
extremities to resolve. If None, we look them up from the
database (via a cache)
Returns:
Deferred[dict[(str, str), str)]]: the state dict, mapping from
(event_type, state_key) -> event_id
"""
if not latest_event_ids:
latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)

logger.debug("calling resolve_state_groups from get_current_state_ids")
ret = yield self.resolve_state_groups(room_id, latest_event_ids)
state = ret.state

if event_type:
defer.returnValue(state.get((event_type, state_key)))
return

defer.returnValue(state)

@defer.inlineCallbacks
Expand Down

0 comments on commit ad48dfe

Please sign in to comment.