summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-09-06 16:46:51 +0100
committerErik Johnston <erik@matrix.org>2018-09-06 16:46:51 +0100
commit7baf66ef5d1575b40b638d4f21204e1646792612 (patch)
tree33b614122586cf1a85ff5c084a80a212c6912ecf
parentMerge pull request #3805 from matrix-org/erikj/limit_transaction_pdus_edus (diff)
downloadsynapse-7baf66ef5d1575b40b638d4f21204e1646792612.tar.xz
Send existing room tags down sync on join
When a user joined a room any existing tags were not sent down the sync
stream. Ordinarily this isn't a problem because the user needs to be in
the room to have set tags in it, however synapse will sometimes add tags
for a user to a room, e.g. for server notices, which need to come down
sync.
-rw-r--r--synapse/handlers/sync.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 9f133ded3f..150d492cb0 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -1575,6 +1575,14 @@ class SyncHandler(object):
             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)
+
         account_data_events = []
         if tags is not None:
             account_data_events.append({