Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use the account data handler in additional places. #9166

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9166.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental support for moving off receipts and account data persistence off master.
3 changes: 2 additions & 1 deletion synapse/server_notices/resource_limits_server_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, hs):
self._auth = hs.get_auth()
self._config = hs.config
self._resouce_limited = False
self._account_data_handler = hs.get_account_data_handler()
self._message_handler = hs.get_message_handler()
self._state = hs.get_state_handler()

Expand Down Expand Up @@ -177,7 +178,7 @@ async def _check_and_set_tags(self, user_id: str, room_id: str) -> None:
# tag already present, nothing to do here
need_to_set_tag = False
if need_to_set_tag:
max_id = await self._store.add_tag_to_room(
max_id = await self._account_data_handler.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])
Expand Down
3 changes: 2 additions & 1 deletion synapse/server_notices/server_notices_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self, hs):

self._store = hs.get_datastore()
self._config = hs.config
self._account_data_handler = hs.get_account_data_handler()
self._room_creation_handler = hs.get_room_creation_handler()
self._room_member_handler = hs.get_room_member_handler()
self._event_creation_handler = hs.get_event_creation_handler()
Expand Down Expand Up @@ -163,7 +164,7 @@ async def get_or_create_notice_room_for_user(self, user_id: str) -> str:
)
room_id = info["room_id"]

max_id = await self._store.add_tag_to_room(
max_id = await self._account_data_handler.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])
Expand Down