diff options
author | Will Hunt <half-shot@molrams.com> | 2017-03-15 15:17:16 +0000 |
---|---|---|
committer | Will Hunt <half-shot@molrams.com> | 2017-03-15 15:17:16 +0000 |
commit | ebf5a6b14c9a8f4d82969600ddbbc89d9bb8d935 (patch) | |
tree | c335410efb7dabc862ddc3759a4bbf0490aebef3 /synapse/handlers/presence.py | |
parent | Merge pull request #2010 from matrix-org/rav/fix_txnq_wedge (diff) | |
download | synapse-ebf5a6b14c9a8f4d82969600ddbbc89d9bb8d935.tar.xz |
Add fallback to last_active_ts if it beats the last sync time.
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r-- | synapse/handlers/presence.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index da610e430f..7bd6f7d1e4 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -1157,7 +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 now - state.last_user_sync_ts > SYNC_ONLINE_TIMEOUT: + 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( state=PresenceState.OFFLINE, status_msg=None, |