summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-08-24 16:22:37 +0100
committerErik Johnston <erik@matrix.org>2018-08-24 16:22:37 +0100
commit01a5a8b9e3f4ce0b4e2419df5dc3645de0428629 (patch)
tree009dbb14b8c2e2344bb6b7d7ade9c871721a11ea /synapse
parentMerge pull request #3755 from matrix-org/erikj/fix_server_notice_tags (diff)
downloadsynapse-01a5a8b9e3f4ce0b4e2419df5dc3645de0428629.tar.xz
Fix checking if service notice room is already tagged
This manifested in synapse repeatedly setting the tag for the room
Diffstat (limited to 'synapse')
-rw-r--r--synapse/server_notices/resource_limits_server_notices.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py
index 893b9001cd..5d86114e09 100644
--- a/synapse/server_notices/resource_limits_server_notices.py
+++ b/synapse/server_notices/resource_limits_server_notices.py
@@ -146,11 +146,10 @@ class ResourceLimitsServerNotices(object):
             user_id(str): the user in question
             room_id(str): the server notices room for that user
         """
-        tags = yield self._store.get_tags_for_user(user_id)
-        server_notices_tags = tags.get(room_id)
+        tags = yield self._store.get_tags_for_room(user_id, room_id)
         need_to_set_tag = True
-        if server_notices_tags:
-            if server_notices_tags.get(SERVER_NOTICE_ROOM_TAG):
+        if tags:
+            if SERVER_NOTICE_ROOM_TAG in tags:
                 # tag already present, nothing to do here
                 need_to_set_tag = False
         if need_to_set_tag: