summary refs log tree commit diff
path: root/synapse/config/server.py
diff options
context:
space:
mode:
authorMichael Hollister <michael.s.hollister@protonmail.com>2024-07-23 04:59:24 -0500
committerGitHub <noreply@github.com>2024-07-23 09:59:24 +0000
commita9ee832e4899fefcfd27fba475091e1ffaa069b8 (patch)
tree5e5922d2aaf6c388150a978905bc001653b954ab /synapse/config/server.py
parentBump hiredis from 2.3.2 to 3.0.0 (#17464) (diff)
downloadsynapse-a9ee832e4899fefcfd27fba475091e1ffaa069b8.tar.xz
Fixed presence results not returning offline users on initial sync (#17231)
This is to address an issue in which `m.presence` results on initial
sync are not returning entries of users who are currently offline.

The original behaviour was from
https://github.com/element-hq/synapse/issues/1535

This change is useful for applications that use the
presence system for tracking user profile information/updates (e.g.
https://github.com/element-hq/synapse/pull/16992 or for profile status
messages).

This is gated behind a new configuration option to avoid performance
impact for applications that don't need this, as a pragmatic solution
for now.
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r--synapse/config/server.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index 8bb97df175..fd52c0475c 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -384,6 +384,11 @@ class ServerConfig(Config):
         # Whether to internally track presence, requires that presence is enabled,
         self.track_presence = self.presence_enabled and presence_enabled != "untracked"
 
+        # Determines if presence results for offline users are included on initial/full sync
+        self.presence_include_offline_users_on_sync = presence_config.get(
+            "include_offline_users_on_sync", False
+        )
+
         # Custom presence router module
         # This is the legacy way of configuring it (the config should now be put in the modules section)
         self.presence_router_module_class = None