summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-06 10:28:35 +0100
committerErik Johnston <erik@matrix.org>2016-09-06 10:28:35 +0100
commit438ef4763704fb90c3aa0b7aa0c688607e60b010 (patch)
treefa4fc9b98fbccc813d946f20004000b28a30b8b8 /synapse/handlers/presence.py
parentFiddle should_notify to better report stats (diff)
downloadsynapse-438ef4763704fb90c3aa0b7aa0c688607e60b010.tar.xz
Short circuit if presence is the same
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index af389b590f..a9f5233119 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -941,6 +941,9 @@ class PresenceHandler(object):
 def should_notify(old_state, new_state):
     """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:
         notify_reason_counter.inc("status_msg_change")
         return True