summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorMathieu Velten <mathieuv@matrix.org>2023-08-22 16:47:59 +0200
committerGitHub <noreply@github.com>2023-08-22 14:47:59 +0000
commit0ba17777be81ba9457defb407112b664042a14d2 (patch)
tree3eea0de6202c4686023bce0c08691eb9c9f90342 /synapse/config
parentAdd an admin endpoint to allow authorizing server to signal token revocations... (diff)
downloadsynapse-0ba17777be81ba9457defb407112b664042a14d2.tar.xz
Disable `m.3pid_changes` capability when MSC3861 is enabled. (#16134)
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/experimental.py6
-rw-r--r--synapse/config/registration.py11
2 files changed, 16 insertions, 1 deletions
diff --git a/synapse/config/experimental.py b/synapse/config/experimental.py
index d4cf9a0555..277ea4675b 100644
--- a/synapse/config/experimental.py
+++ b/synapse/config/experimental.py
@@ -223,6 +223,12 @@ class MSC3861:
                 ("session_lifetime",),
             )
 
+        if root.registration.enable_3pid_changes:
+            raise ConfigError(
+                "enable_3pid_changes cannot be enabled when OAuth delegation is enabled",
+                ("enable_3pid_changes",),
+            )
+
 
 @attr.s(auto_attribs=True, frozen=True, slots=True)
 class MSC3866Config:
diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index df1d83dfaa..b8ad6fbc06 100644
--- a/synapse/config/registration.py
+++ b/synapse/config/registration.py
@@ -133,7 +133,16 @@ class RegistrationConfig(Config):
 
         self.enable_set_displayname = config.get("enable_set_displayname", True)
         self.enable_set_avatar_url = config.get("enable_set_avatar_url", True)
-        self.enable_3pid_changes = config.get("enable_3pid_changes", True)
+
+        # The default value of enable_3pid_changes is True, unless msc3861 is enabled.
+        msc3861_enabled = (
+            (config.get("experimental_features") or {})
+            .get("msc3861", {})
+            .get("enabled", False)
+        )
+        self.enable_3pid_changes = config.get(
+            "enable_3pid_changes", not msc3861_enabled
+        )
 
         self.disable_msisdn_registration = config.get(
             "disable_msisdn_registration", False