diff options
author | Matthew Hodgson <matthew@matrix.org> | 2018-11-03 12:14:24 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2018-11-03 12:14:24 +0000 |
commit | 6e7488ce1166ffb1f70777b4db2e9008f3303a04 (patch) | |
tree | 4cd62ccc22a7eb9630b875e18e05cf4017f62218 /synapse/handlers/pagination.py | |
parent | Merge pull request #4047 from matrix-org/michaelkaye/dinsic_allow_user_direct... (diff) | |
parent | Merge branch 'release-v0.33.8' (diff) | |
download | synapse-6e7488ce1166ffb1f70777b4db2e9008f3303a04.tar.xz |
merge master into dinsic, again...
Diffstat (limited to 'synapse/handlers/pagination.py')
-rw-r--r-- | synapse/handlers/pagination.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/synapse/handlers/pagination.py b/synapse/handlers/pagination.py index 5170d093e3..43f81bd607 100644 --- a/synapse/handlers/pagination.py +++ b/synapse/handlers/pagination.py @@ -21,6 +21,7 @@ from twisted.python.failure import Failure from synapse.api.constants import EventTypes, Membership from synapse.api.errors import SynapseError from synapse.events.utils import serialize_event +from synapse.storage.state import StateFilter from synapse.types import RoomStreamToken from synapse.util.async_helpers import ReadWriteLock from synapse.util.logcontext import run_in_background @@ -255,28 +256,19 @@ class PaginationHandler(object): if event_filter and event_filter.lazy_load_members(): # TODO: remove redundant members - types = [ - (EventTypes.Member, state_key) - for state_key in set( - event.sender # FIXME: we also care about invite targets etc. - for event in events - ) - ] + # FIXME: we also care about invite targets etc. + state_filter = StateFilter.from_types( + (EventTypes.Member, event.sender) + for event in events + ) state_ids = yield self.store.get_state_ids_for_event( - events[0].event_id, types=types, + events[0].event_id, state_filter=state_filter, ) if state_ids: state = yield self.store.get_events(list(state_ids.values())) - - if state: - state = yield filter_events_for_client( - self.store, - user_id, - state.values(), - is_peeking=(member_event_id is None), - ) + state = state.values() time_now = self.clock.time_msec() |