mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Don't notify for online -> online transitions.
Specifically, if currently_active remains true then we should not notify if only the last active time changes.
This commit is contained in:
parent
67f0c990f8
commit
bc1a8b1f7a
2 changed files with 53 additions and 1 deletions
|
@ -922,7 +922,12 @@ def should_notify(old_state, new_state):
|
|||
if new_state.currently_active != old_state.currently_active:
|
||||
return True
|
||||
|
||||
if new_state.last_active_ts - old_state.last_active_ts > LAST_ACTIVE_GRANULARITY:
|
||||
if new_state.last_active_ts - old_state.last_active_ts > LAST_ACTIVE_GRANULARITY:
|
||||
# Only notify about last active bumps if we're not currently acive
|
||||
if not (old_state.currently_active and new_state.currently_active):
|
||||
return True
|
||||
|
||||
elif new_state.last_active_ts - old_state.last_active_ts > LAST_ACTIVE_GRANULARITY:
|
||||
# Always notify for a transition where last active gets bumped.
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue