mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
Don't set currently_active for remote presence
This commit is contained in:
parent
5f4eca3816
commit
929cb0ed7d
2 changed files with 27 additions and 10 deletions
|
@ -995,6 +995,18 @@ def handle_update(prev_state, new_state, is_mine, wheel_timer, now):
|
|||
then=new_state.last_active_ts + IDLE_TIMER
|
||||
)
|
||||
|
||||
active = now - new_state.last_active_ts < LAST_ACTIVE_GRANULARITY
|
||||
new_state = new_state.copy_and_replace(
|
||||
currently_active=active,
|
||||
)
|
||||
|
||||
if active:
|
||||
wheel_timer.insert(
|
||||
now=now,
|
||||
obj=user_id,
|
||||
then=new_state.last_active_ts + LAST_ACTIVE_GRANULARITY
|
||||
)
|
||||
|
||||
if new_state.state != PresenceState.OFFLINE:
|
||||
# User has stopped syncing
|
||||
wheel_timer.insert(
|
||||
|
@ -1018,12 +1030,6 @@ def handle_update(prev_state, new_state, is_mine, wheel_timer, now):
|
|||
then=new_state.last_federation_update_ts + FEDERATION_TIMEOUT
|
||||
)
|
||||
|
||||
if new_state.state == PresenceState.ONLINE:
|
||||
active = now - new_state.last_active_ts < LAST_ACTIVE_GRANULARITY
|
||||
new_state = new_state.copy_and_replace(
|
||||
currently_active=active,
|
||||
)
|
||||
|
||||
# Check whether the change was something worth notifying about
|
||||
if should_notify(prev_state, new_state):
|
||||
new_state = new_state.copy_and_replace(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue