mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-18 15:59:13 -04:00
Short circuit if presence is the same
This commit is contained in:
parent
74a3b4a650
commit
438ef47637
1 changed files with 3 additions and 0 deletions
|
@ -941,6 +941,9 @@ class PresenceHandler(object):
|
||||||
def should_notify(old_state, new_state):
|
def should_notify(old_state, new_state):
|
||||||
"""Decides if a presence state change should be sent to interested parties.
|
"""Decides if a presence state change should be sent to interested parties.
|
||||||
"""
|
"""
|
||||||
|
if old_state == new_state:
|
||||||
|
return False
|
||||||
|
|
||||||
if old_state.status_msg != new_state.status_msg:
|
if old_state.status_msg != new_state.status_msg:
|
||||||
notify_reason_counter.inc("status_msg_change")
|
notify_reason_counter.inc("status_msg_change")
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue