mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 16:05:00 -04:00
Implement MSC3890: Remotely silence local notifications (#14775)
This commit is contained in:
parent
52ae80dd1a
commit
54cd90ea60
5 changed files with 29 additions and 2 deletions
|
@ -346,6 +346,7 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
super().__init__(hs)
|
||||
|
||||
self.federation_sender = hs.get_federation_sender()
|
||||
self._account_data_handler = hs.get_account_data_handler()
|
||||
self._storage_controllers = hs.get_storage_controllers()
|
||||
|
||||
self.device_list_updater = DeviceListUpdater(hs, self)
|
||||
|
@ -502,7 +503,7 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
else:
|
||||
raise
|
||||
|
||||
# Delete access tokens and e2e keys for each device. Not optimised as it is not
|
||||
# Delete data specific to each device. Not optimised as it is not
|
||||
# considered as part of a critical path.
|
||||
for device_id in device_ids:
|
||||
await self._auth_handler.delete_access_tokens_for_user(
|
||||
|
@ -512,6 +513,14 @@ class DeviceHandler(DeviceWorkerHandler):
|
|||
user_id=user_id, device_id=device_id
|
||||
)
|
||||
|
||||
if self.hs.config.experimental.msc3890_enabled:
|
||||
# Remove any local notification settings for this device in accordance
|
||||
# with MSC3890.
|
||||
await self._account_data_handler.remove_account_data_for_user(
|
||||
user_id,
|
||||
f"org.matrix.msc3890.local_notification_settings.{device_id}",
|
||||
)
|
||||
|
||||
await self.notify_device_update(user_id, device_ids)
|
||||
|
||||
async def update_device(self, user_id: str, device_id: str, content: dict) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue