summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-11-09 15:16:17 +0000
committerMark Haines <mjark@negativecurvature.net>2015-11-09 15:16:17 +0000
commitb1953a96273f434e20d733af73bf1e95f24d0984 (patch)
tree02aba4e8638e248f4452fbde91963ca01e02cc50
parentfix comedy important missing comma breaking recent-ordered FTS on sqlite (diff)
parentMerge branch 'develop' into markjh/SYN-513 (diff)
downloadsynapse-b1953a96273f434e20d733af73bf1e95f24d0984.tar.xz
Merge pull request #354 from matrix-org/markjh/SYN-513
SYN-513: Include updates for rooms that have had all their tags deleted
-rw-r--r--synapse/handlers/sync.py2
-rw-r--r--synapse/storage/tags.py3
2 files changed, 2 insertions, 3 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 5294d96466..ff766e3af5 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -272,7 +272,7 @@ class SyncHandler(BaseHandler):
     def private_user_data_for_room(self, room_id, tags_by_room):
         private_user_data = []
         tags = tags_by_room.get(room_id)
-        if tags:
+        if tags is not None:
             private_user_data.append({
                 "type": "m.tag",
                 "content": {"tags": tags},
diff --git a/synapse/storage/tags.py b/synapse/storage/tags.py
index 73babd53d9..bf695b7800 100644
--- a/synapse/storage/tags.py
+++ b/synapse/storage/tags.py
@@ -95,8 +95,7 @@ class TagsStore(SQLBaseStore):
         if room_ids:
             tags_by_room = yield self.get_tags_for_user(user_id)
             for room_id in room_ids:
-                if room_id in tags_by_room:
-                    results[room_id] = tags_by_room[room_id]
+                results[room_id] = tags_by_room.get(room_id, {})
 
         defer.returnValue(results)