diff options
author | H. Shay <hillerys@element.io> | 2023-05-02 11:39:37 -0700 |
---|---|---|
committer | H. Shay <hillerys@element.io> | 2023-05-02 11:39:37 -0700 |
commit | e53a8a5baf1af9482f195a8879671192e07d96b2 (patch) | |
tree | 205dbee91b7e214e48a9a5f88e1b12811cdb00bc | |
parent | stupid github web editor (diff) | |
download | synapse-e53a8a5baf1af9482f195a8879671192e07d96b2.tar.xz |
change how config is checked
-rw-r--r-- | synapse/handlers/presence.py | 18 | ||||
-rw-r--r-- | synapse/rest/client/keys.py | 7 | ||||
-rw-r--r-- | synapse/rest/client/pusher.py | 18 |
3 files changed, 23 insertions, 20 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 08649eaf7b..f681beb92e 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -605,11 +605,12 @@ class WorkerPresenceHandler(BasePresenceHandler): PresenceState.BUSY, ) - busy_presence_enabled = await self.hs.get_datastores().main.get_feature_enabled( - target_user.to_string(), "msc3026" + busy_presence_enabled = ( + await self.hs.get_datastores().main.get_feature_enabled( + target_user.to_string(), "msc3026" + ) + or self.hs.config.experimental.msc3026_enabled ) - if not busy_presence_enabled: - busy_presence_enabled = self.hs.config.experimental.msc3026_enabled if presence not in valid_presence or ( presence == PresenceState.BUSY and not busy_presence_enabled @@ -1240,11 +1241,12 @@ class PresenceHandler(BasePresenceHandler): PresenceState.BUSY, ) - busy_presence_enabled = await self.hs.get_datastores().main.get_feature_enabled( - target_user.to_string(), "msc3026" + busy_presence_enabled = ( + await self.hs.get_datastores().main.get_feature_enabled( + target_user.to_string(), "msc3026" + ) + or self.hs.config.experimental.msc3026_enabled ) - if not busy_presence_enabled: - busy_presence_enabled = self.hs.config.experimental.msc3026_enabled if presence not in valid_presence or ( presence == PresenceState.BUSY and not busy_presence_enabled diff --git a/synapse/rest/client/keys.py b/synapse/rest/client/keys.py index 08bd38d7aa..5d8b9239a4 100644 --- a/synapse/rest/client/keys.py +++ b/synapse/rest/client/keys.py @@ -375,11 +375,10 @@ class SigningKeyUploadServlet(RestServlet): user_id = requester.user.to_string() body = parse_json_object_from_request(request) - msc3967_enabled = await self.hs.get_datastores().main.get_feature_enabled( - user_id, "msc3967" + msc3967_enabled = ( + await self.hs.get_datastores().main.get_feature_enabled(user_id, "msc3967") + or self.hs.config.experimental.msc2654_enabled ) - if not msc3967_enabled: - msc3967_enabled = self.hs.config.experimental.msc2654_enabled if msc3967_enabled: if await self.e2e_keys_handler.is_cross_signing_set_up_for_user(user_id): diff --git a/synapse/rest/client/pusher.py b/synapse/rest/client/pusher.py index d6c0f1bd16..40c4b6adc3 100644 --- a/synapse/rest/client/pusher.py +++ b/synapse/rest/client/pusher.py @@ -53,11 +53,12 @@ class PushersRestServlet(RestServlet): pusher_dicts = [p.as_dict() for p in pushers] - msc3881_enabled = await self.hs.get_datastores().main.get_feature_enabled( - user.to_string(), "msc3881" + msc3881_enabled = ( + await self.hs.get_datastores().main.get_feature_enabled( + user.to_string(), "msc3881" + ) + or self.hs.config.experimental.msc3881_enabled ) - if not msc3881_enabled: - msc3881_enabled = self.hs.config.experimental.msc3881_enabled for pusher in pusher_dicts: if msc3881_enabled: @@ -117,11 +118,12 @@ class PushersSetRestServlet(RestServlet): append = content["append"] enabled = True - msc3881_enabled = await self.hs.get_datastores().main.get_feature_enabled( - user.to_string(), "msc3881" + msc3881_enabled = ( + await self.hs.get_datastores().main.get_feature_enabled( + user.to_string(), "msc3881" + ) + or self.hs.config.experimental.msc3881_enabled ) - if not msc3881_enabled: - msc3881_enabled = self.hs.config.experimental.msc3881_enabled if msc3881_enabled and "org.matrix.msc3881.enabled" in content: enabled = content["org.matrix.msc3881.enabled"] |