diff options
author | Neil Johnson <neil@matrix.org> | 2018-08-16 17:02:04 +0100 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2018-08-16 17:02:04 +0100 |
commit | 3c1080b6e4a4d7c80d67bd9bee45d845aa145088 (patch) | |
tree | b0a8e34776648e8f620c509359bbb27ca8417359 /synapse/server_notices/server_notices_manager.py | |
parent | add room tagging (diff) | |
download | synapse-3c1080b6e4a4d7c80d67bd9bee45d845aa145088.tar.xz |
refactor for readability, and reuse caching for setting tags
Diffstat (limited to 'synapse/server_notices/server_notices_manager.py')
-rw-r--r-- | synapse/server_notices/server_notices_manager.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/server_notices/server_notices_manager.py b/synapse/server_notices/server_notices_manager.py index 22c819cc5b..5968104a99 100644 --- a/synapse/server_notices/server_notices_manager.py +++ b/synapse/server_notices/server_notices_manager.py @@ -22,6 +22,8 @@ from synapse.util.caches.descriptors import cachedInlineCallbacks logger = logging.getLogger(__name__) +SERVER_NOTICE_ROOM_TAG = "m.server_notice" + class ServerNoticesManager(object): def __init__(self, hs): @@ -151,7 +153,9 @@ class ServerNoticesManager(object): creator_join_profile=join_profile, ) room_id = info['room_id'] - yield self._store.add_tag_to_room(user_id, room_id, 'm.server_notice', None) + yield self._store.add_tag_to_room( + user_id, room_id, SERVER_NOTICE_ROOM_TAG, None + ) logger.info("Created server notices room %s for %s", room_id, user_id) defer.returnValue(room_id) |