mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Add a great comment to handle_timeout for active vs sync times.
This commit is contained in:
parent
ebf5a6b14c
commit
e6032054bf
@ -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),
|
# If there are have been no sync for a while (and none ongoing),
|
||||||
# set presence to offline
|
# set presence to offline
|
||||||
if user_id not in syncing_user_ids:
|
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)
|
sync_or_active = max(state.last_user_sync_ts, state.last_active_ts)
|
||||||
if now - sync_or_active > SYNC_ONLINE_TIMEOUT:
|
if now - sync_or_active > SYNC_ONLINE_TIMEOUT:
|
||||||
state = state.copy_and_replace(
|
state = state.copy_and_replace(
|
||||||
|
Loading…
Reference in New Issue
Block a user