mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Merge pull request #3756 from matrix-org/erikj/fix_tags_server_notices
Fix checking if service notice room is already tagged
This commit is contained in:
commit
48b04c4a4c
1
changelog.d/3756.bugfix
Normal file
1
changelog.d/3756.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix tagging of server notice rooms
|
@ -146,11 +146,10 @@ class ResourceLimitsServerNotices(object):
|
|||||||
user_id(str): the user in question
|
user_id(str): the user in question
|
||||||
room_id(str): the server notices room for that user
|
room_id(str): the server notices room for that user
|
||||||
"""
|
"""
|
||||||
tags = yield self._store.get_tags_for_user(user_id)
|
tags = yield self._store.get_tags_for_room(user_id, room_id)
|
||||||
server_notices_tags = tags.get(room_id)
|
|
||||||
need_to_set_tag = True
|
need_to_set_tag = True
|
||||||
if server_notices_tags:
|
if tags:
|
||||||
if server_notices_tags.get(SERVER_NOTICE_ROOM_TAG):
|
if SERVER_NOTICE_ROOM_TAG in tags:
|
||||||
# tag already present, nothing to do here
|
# tag already present, nothing to do here
|
||||||
need_to_set_tag = False
|
need_to_set_tag = False
|
||||||
if need_to_set_tag:
|
if need_to_set_tag:
|
||||||
|
@ -55,6 +55,7 @@ class TestResourceLimitsServerNotices(unittest.TestCase):
|
|||||||
returnValue=""
|
returnValue=""
|
||||||
)
|
)
|
||||||
self._rlsn._store.add_tag_to_room = Mock()
|
self._rlsn._store.add_tag_to_room = Mock()
|
||||||
|
self._rlsn._store.get_tags_for_room = Mock(return_value={})
|
||||||
self.hs.config.admin_uri = "mailto:user@test.com"
|
self.hs.config.admin_uri = "mailto:user@test.com"
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
Loading…
Reference in New Issue
Block a user