summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-11-04 17:55:12 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2021-11-16 12:49:17 +0000
commit7fbfedb230bd5bcead8335f3e4c466086eae6638 (patch)
tree0398893440e12af14e93c77fab63ad6ae1c28365
parentAdd ability to un-shadow-ban via the admin API. (#11347) (diff)
downloadsynapse-7fbfedb230bd5bcead8335f3e4c466086eae6638.tar.xz
Add experimental config option to send to-device messages to AS's
-rw-r--r--synapse/config/experimental.py8
-rw-r--r--synapse/handlers/appservice.py3
2 files changed, 11 insertions, 0 deletions
diff --git a/synapse/config/experimental.py b/synapse/config/experimental.py
index 8b098ad48d..593195ae90 100644
--- a/synapse/config/experimental.py
+++ b/synapse/config/experimental.py
@@ -46,3 +46,11 @@ class ExperimentalConfig(Config):
 
         # MSC3266 (room summary api)
         self.msc3266_enabled: bool = experimental.get("msc3266_enabled", False)
+
+        # MSC2409 (this setting only relates to optionally sending to-device messages).
+        # Presence, typing and read receipt EDUs are already sent to application services that
+        # have opted in to receive them. This setting, if enabled, adds to-device messages
+        # to that list.
+        self.msc2409_to_device_messages_enabled: bool = experimental.get(
+            "msc2409_to_device_messages_enabled", False
+        )
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index 9abdad262b..cd042e35b7 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -55,6 +55,9 @@ class ApplicationServicesHandler:
         self.clock = hs.get_clock()
         self.notify_appservices = hs.config.appservice.notify_appservices
         self.event_sources = hs.get_event_sources()
+        self.msc2409_to_device_messages_enabled = (
+            hs.config.experimental.msc2409_to_device_messages_enabled
+        )
 
         self.current_max = 0
         self.is_processing = False