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

Send existing room tags down sync on join #3810

Merged
merged 3 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3810.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix existing room tags not coming down sync when joining a room
13 changes: 13 additions & 0 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,19 @@ def _generate_room_entry(self, sync_result_builder, ignored_users,
newly_joined_room=newly_joined,
)

# When we join the room (or the client requests full_state), we should
# send down any existing tags. Usually the user won't have tags in a
# newly joined room, unless either a) they've joined before or b) the
# tag was added by synapse e.g. for server notice rooms.
if full_state:
user_id = sync_result_builder.sync_config.user.to_string()
tags = yield self.store.get_tags_for_room(user_id, room_id)

# If there aren't any tags, don't send the empty tags list down
# sync
if not tags:
tags = None

account_data_events = []
if tags is not None:
account_data_events.append({
Expand Down