summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-02-13 13:23:03 +0000
committerGitHub <noreply@github.com>2024-02-13 13:23:03 +0000
commit01910b981f332a4ccf093bcae9f8e4b7dd3cbc13 (patch)
tree2e1bb4149a26d5406c10992d67b9bb228e70662c /synapse/config
parentBump pygithub from 2.1.1 to 2.2.0 (#16902) (diff)
downloadsynapse-01910b981f332a4ccf093bcae9f8e4b7dd3cbc13.tar.xz
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.
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/registration.py8
1 files changed, 8 insertions, 0 deletions
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: