diff options
author | Erik Johnston <erikj@jki.re> | 2017-09-18 17:22:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 17:22:33 +0100 |
commit | 77c81ca6ea00488a13cda33b865ffdcae9086512 (patch) | |
tree | 9341b47a896f3bacca65e173164ab50e2daac976 /synapse/handlers/sync.py | |
parent | Merge pull request #2450 from matrix-org/dbkr/push_event_id_only (diff) | |
parent | Don't filter out current state events from timeline (diff) | |
download | synapse-77c81ca6ea00488a13cda33b865ffdcae9086512.tar.xz |
Merge pull request #2451 from matrix-org/erikj/add_state_to_timeline
Don't filter out current state events from timeline
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r-- | synapse/handlers/sync.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index c6b04a1683..bb78c25ee5 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -293,6 +293,11 @@ class SyncHandler(object): timeline_limit = sync_config.filter_collection.timeline_limit() block_all_timeline = sync_config.filter_collection.blocks_all_room_timeline() + # Pull out the current state, as we always want to include those events + # in the timeline if they're there. + current_state_ids = yield self.state.get_current_state_ids(room_id) + current_state_ids = frozenset(current_state_ids.itervalues()) + if recents is None or newly_joined_room or timeline_limit < len(recents): limited = True else: @@ -304,6 +309,7 @@ class SyncHandler(object): self.store, sync_config.user.to_string(), recents, + always_include_ids=current_state_ids, ) else: recents = [] @@ -339,6 +345,7 @@ class SyncHandler(object): self.store, sync_config.user.to_string(), loaded_recents, + always_include_ids=current_state_ids, ) loaded_recents.extend(recents) recents = loaded_recents |