mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-21 06:04:19 -05:00
Merge pull request #304 from matrix-org/erikj/remove_unused_arg
Remove unused room_id arg
This commit is contained in:
commit
d7c70d09f0
@ -242,7 +242,7 @@ class FederationHandler(BaseHandler):
|
||||
@defer.inlineCallbacks
|
||||
def _filter_events_for_server(self, server_name, room_id, events):
|
||||
event_to_state = yield self.store.get_state_for_events(
|
||||
room_id, frozenset(e.event_id for e in events),
|
||||
frozenset(e.event_id for e in events),
|
||||
types=(
|
||||
(EventTypes.RoomHistoryVisibility, ""),
|
||||
(EventTypes.Member, None),
|
||||
|
@ -164,7 +164,7 @@ class MessageHandler(BaseHandler):
|
||||
@defer.inlineCallbacks
|
||||
def _filter_events_for_client(self, user_id, room_id, events):
|
||||
event_id_to_state = yield self.store.get_state_for_events(
|
||||
room_id, frozenset(e.event_id for e in events),
|
||||
frozenset(e.event_id for e in events),
|
||||
types=(
|
||||
(EventTypes.RoomHistoryVisibility, ""),
|
||||
(EventTypes.Member, user_id),
|
||||
@ -290,7 +290,7 @@ class MessageHandler(BaseHandler):
|
||||
elif member_event.membership == Membership.LEAVE:
|
||||
key = (event_type, state_key)
|
||||
room_state = yield self.store.get_state_for_events(
|
||||
room_id, [member_event.event_id], [key]
|
||||
[member_event.event_id], [key]
|
||||
)
|
||||
data = room_state[member_event.event_id].get(key)
|
||||
|
||||
@ -314,7 +314,7 @@ class MessageHandler(BaseHandler):
|
||||
room_state = yield self.state_handler.get_current_state(room_id)
|
||||
elif member_event.membership == Membership.LEAVE:
|
||||
room_state = yield self.store.get_state_for_events(
|
||||
room_id, [member_event.event_id], None
|
||||
[member_event.event_id], None
|
||||
)
|
||||
room_state = room_state[member_event.event_id]
|
||||
|
||||
@ -406,7 +406,7 @@ class MessageHandler(BaseHandler):
|
||||
elif event.membership == Membership.LEAVE:
|
||||
room_end_token = "s%d" % (event.stream_ordering,)
|
||||
deferred_room_state = self.store.get_state_for_events(
|
||||
event.room_id, [event.event_id], None
|
||||
[event.event_id], None
|
||||
)
|
||||
deferred_room_state.addCallback(
|
||||
lambda states: states[event.event_id]
|
||||
@ -499,7 +499,7 @@ class MessageHandler(BaseHandler):
|
||||
def _room_initial_sync_parted(self, user_id, room_id, pagin_config,
|
||||
member_event):
|
||||
room_state = yield self.store.get_state_for_events(
|
||||
member_event.room_id, [member_event.event_id], None
|
||||
[member_event.event_id], None
|
||||
)
|
||||
|
||||
room_state = room_state[member_event.event_id]
|
||||
|
@ -312,7 +312,7 @@ class SyncHandler(BaseHandler):
|
||||
@defer.inlineCallbacks
|
||||
def _filter_events_for_client(self, user_id, room_id, events):
|
||||
event_id_to_state = yield self.store.get_state_for_events(
|
||||
room_id, frozenset(e.event_id for e in events),
|
||||
frozenset(e.event_id for e in events),
|
||||
types=(
|
||||
(EventTypes.RoomHistoryVisibility, ""),
|
||||
(EventTypes.Member, user_id),
|
||||
|
@ -54,7 +54,7 @@ class StateStore(SQLBaseStore):
|
||||
defer.returnValue({})
|
||||
|
||||
event_to_groups = yield self._get_state_group_for_events(
|
||||
room_id, event_ids,
|
||||
event_ids,
|
||||
)
|
||||
|
||||
groups = set(event_to_groups.values())
|
||||
@ -208,7 +208,7 @@ class StateStore(SQLBaseStore):
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def get_state_for_events(self, room_id, event_ids, types):
|
||||
def get_state_for_events(self, event_ids, types):
|
||||
"""Given a list of event_ids and type tuples, return a list of state
|
||||
dicts for each event. The state dicts will only have the type/state_keys
|
||||
that are in the `types` list.
|
||||
@ -225,7 +225,7 @@ class StateStore(SQLBaseStore):
|
||||
The dicts are mappings from (type, state_key) -> state_events
|
||||
"""
|
||||
event_to_groups = yield self._get_state_group_for_events(
|
||||
room_id, event_ids,
|
||||
event_ids,
|
||||
)
|
||||
|
||||
groups = set(event_to_groups.values())
|
||||
@ -251,8 +251,8 @@ class StateStore(SQLBaseStore):
|
||||
)
|
||||
|
||||
@cachedList(cache=_get_state_group_for_event.cache, list_name="event_ids",
|
||||
num_args=2)
|
||||
def _get_state_group_for_events(self, room_id, event_ids):
|
||||
num_args=1)
|
||||
def _get_state_group_for_events(self, event_ids):
|
||||
"""Returns mapping event_id -> state_group
|
||||
"""
|
||||
def f(txn):
|
||||
|
Loading…
Reference in New Issue
Block a user