summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-10-30 16:22:32 +0000
committerMark Haines <mark.haines@matrix.org>2015-10-30 16:22:32 +0000
commitfdf73c6855f2b043f1af451e77e2413049a21ab2 (patch)
tree79bd96e9e6403250006ffdd8e2a1ccacbde628f7 /synapse/handlers/message.py
parentInform the client of new room tags using v1 /events (diff)
downloadsynapse-fdf73c6855f2b043f1af451e77e2413049a21ab2.tar.xz
Include room tags v1 /initialSync
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 024474d5fe..c5dce3008c 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -322,6 +322,8 @@ class MessageHandler(BaseHandler):
             user, pagination_config.get_source_config("receipt"), None
         )
 
+        tags_by_room = yield self.store.get_tags_for_user(user_id)
+
         public_room_ids = yield self.store.get_public_room_ids()
 
         limit = pagin_config.limit
@@ -398,6 +400,16 @@ class MessageHandler(BaseHandler):
                     serialize_event(c, time_now, as_client_event)
                     for c in current_state.values()
                 ]
+
+                private_user_data = []
+                tags = tags_by_room.get(event.room_id)
+                if tags:
+                    private_user_data.append({
+                        "room_id": event.room_id,
+                        "type": "m.tag",
+                        "content": {"tags": tags},
+                    })
+                d["private_user_data"] = private_user_data
             except:
                 logger.exception("Failed to get snapshot")