summary refs log tree commit diff
path: root/synapse/handlers/account_data.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-12-01 19:15:27 +0000
committerMark Haines <mark.haines@matrix.org>2015-12-01 19:15:27 +0000
commitf73ea0bda26a51794abedb65cbf4d0a717dee26c (patch)
tree64fd41675594a7c71a7f119fb68b5b476f9173fd /synapse/handlers/account_data.py
parentOnly fire user_joined_room on the distributor if the user has actually joined... (diff)
parentMerge pull request #392 from matrix-org/markjh/client_config (diff)
downloadsynapse-f73ea0bda26a51794abedb65cbf4d0a717dee26c.tar.xz
Merge branch 'develop' into markjh/edu_frequency
Diffstat (limited to 'synapse/handlers/account_data.py')
-rw-r--r--synapse/handlers/account_data.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/synapse/handlers/account_data.py b/synapse/handlers/account_data.py
index 1d35d3b7dc..fe773bee9b 100644
--- a/synapse/handlers/account_data.py
+++ b/synapse/handlers/account_data.py
@@ -29,9 +29,10 @@ class AccountDataEventSource(object):
         last_stream_id = from_key
 
         current_stream_id = yield self.store.get_max_account_data_stream_id()
-        tags = yield self.store.get_updated_tags(user_id, last_stream_id)
 
         results = []
+        tags = yield self.store.get_updated_tags(user_id, last_stream_id)
+
         for room_id, room_tags in tags.items():
             results.append({
                 "type": "m.tag",
@@ -39,6 +40,24 @@ class AccountDataEventSource(object):
                 "room_id": room_id,
             })
 
+        account_data, room_account_data = (
+            yield self.store.get_updated_account_data_for_user(user_id, last_stream_id)
+        )
+
+        for account_data_type, content in account_data.items():
+            results.append({
+                "type": account_data_type,
+                "content": content,
+            })
+
+        for room_id, account_data in room_account_data.items():
+            for account_data_type, content in account_data.items():
+                results.append({
+                    "type": account_data_type,
+                    "content": content,
+                    "room_id": room_id,
+                })
+
         defer.returnValue((results, current_stream_id))
 
     @defer.inlineCallbacks