Ensure we wake up /sync when we add tag to notice room

This commit is contained in:
Erik Johnston 2018-08-24 14:50:03 +01:00
parent 14d49c51db
commit cdd24449ee
2 changed files with 13 additions and 2 deletions

View file

@ -46,6 +46,8 @@ class ResourceLimitsServerNotices(object):
self._message_handler = hs.get_message_handler()
self._state = hs.get_state_handler()
self._notifier = hs.get_notifier()
@defer.inlineCallbacks
def maybe_send_server_notice_to_user(self, user_id):
"""Check if we need to send a notice to this user, this will be true in
@ -152,9 +154,12 @@ class ResourceLimitsServerNotices(object):
# tag already present, nothing to do here
need_to_set_tag = False
if need_to_set_tag:
yield self._store.add_tag_to_room(
max_id = yield self._store.add_tag_to_room(
user_id, room_id, SERVER_NOTICE_ROOM_TAG, {}
)
self._notifier.on_new_event(
"account_data_key", max_id, users=[user_id]
)
@defer.inlineCallbacks
def _is_room_currently_blocked(self, room_id):