summary refs log tree commit diff
path: root/synapse/app/generic_worker.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-03-18 18:37:19 +0100
committerBrendan Abolivier <babolivier@matrix.org>2021-03-18 18:37:19 +0100
commit066c703729d72b5da8bb6574d7f7f5f13e12f773 (patch)
treeae94a3107441cb06b3d26c6811381470ed27fe22 /synapse/app/generic_worker.py
parentImplement MSC3026: busy presence state (diff)
downloadsynapse-066c703729d72b5da8bb6574d7f7f5f13e12f773.tar.xz
Move support for MSC3026 behind an experimental flag
Diffstat (limited to 'synapse/app/generic_worker.py')
-rw-r--r--synapse/app/generic_worker.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py
index 236d98a29d..207d5ccd02 100644
--- a/synapse/app/generic_worker.py
+++ b/synapse/app/generic_worker.py
@@ -302,6 +302,8 @@ class GenericWorkerPresence(BasePresenceHandler):
             self.send_stop_syncing, UPDATE_SYNCING_USERS_MS
         )
 
+        self._busy_presence_enabled = hs.config.experimental.msc3026_enabled
+
         hs.get_reactor().addSystemEventTrigger(
             "before",
             "shutdown",
@@ -439,8 +441,11 @@ class GenericWorkerPresence(BasePresenceHandler):
             PresenceState.ONLINE,
             PresenceState.UNAVAILABLE,
             PresenceState.OFFLINE,
-            PresenceState.BUSY,
         )
+
+        if self._busy_presence_enabled:
+            valid_presence += (PresenceState.BUSY,)
+
         if presence not in valid_presence:
             raise SynapseError(400, "Invalid presence state")