From 01910b981f332a4ccf093bcae9f8e4b7dd3cbc13 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 13 Feb 2024 13:23:03 +0000 Subject: Add a config to not send out device list updates for specific users (#16909) List of users not to send out device list updates for when they register new devices. This is useful to handle bot accounts. This is undocumented as its mostly a hack to test on matrix.org. Note: This will still send out device list updates if the device is later updated, e.g. end to end keys are added. --- synapse/config/registration.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'synapse/config') diff --git a/synapse/config/registration.py b/synapse/config/registration.py index 9e2b1f3de1..3fe0f050cd 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -237,6 +237,14 @@ class RegistrationConfig(Config): self.inhibit_user_in_use_error = config.get("inhibit_user_in_use_error", False) + # List of user IDs not to send out device list updates for when they + # register new devices. This is useful to handle bot accounts. + # + # Note: This will still send out device list updates if the device is + # later updated, e.g. end to end keys are added. + dont_notify_new_devices_for = config.get("dont_notify_new_devices_for", []) + self.dont_notify_new_devices_for = frozenset(dont_notify_new_devices_for) + def generate_config_section( self, generate_secrets: bool = False, **kwargs: Any ) -> str: -- cgit 1.4.1