summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorWill Hunt <half-shot@molrams.com>2017-03-15 15:24:48 +0000
committerWill Hunt <half-shot@molrams.com>2017-03-15 15:24:48 +0000
commite6032054bf2d449055d88916b89e574ce997745d (patch)
tree21129f4a22724a8801fc5a0ae8cde22e7d662ca3 /synapse/handlers
parentAdd fallback to last_active_ts if it beats the last sync time. (diff)
downloadsynapse-e6032054bf2d449055d88916b89e574ce997745d.tar.xz
Add a great comment to handle_timeout for active vs sync times.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/presence.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 7bd6f7d1e4..6b35312127 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -1157,6 +1157,8 @@ def handle_timeout(state, is_mine, syncing_user_ids, now):
         # If there are have been no sync for a while (and none ongoing),
         # set presence to offline
         if user_id not in syncing_user_ids:
+            # If the user has done something recently but hasn't synced,
+            # don't set them as offline.
             sync_or_active = max(state.last_user_sync_ts, state.last_active_ts)
             if now - sync_or_active > SYNC_ONLINE_TIMEOUT:
                 state = state.copy_and_replace(