summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-01-16 14:20:12 +0000
committerGitHub <noreply@github.com>2023-01-16 14:20:12 +0000
commit4db3331bb95a655bb56ab8333be49ee183f71715 (patch)
tree8490322f2decf01b666871fa17f13a6472fed6ec /synapse
parentRemove unnecessary reactor reference from `_PerHostRatelimiter` (#14842) (diff)
downloadsynapse-4db3331bb95a655bb56ab8333be49ee183f71715.tar.xz
Add an early return when handling no-op presence updates. (#14855)
This stops us from incrementing the presence stream position for no-op updates.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/presence.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 2af90b25a3..43e4e7b1b4 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -2155,6 +2155,11 @@ class PresenceFederationQueue:
         # This should only be called on a presence writer.
         assert self._presence_writer
 
+        if not states or not destinations:
+            # Ignore calls which either don't have any new states or don't need
+            # to be sent anywhere.
+            return
+
         if self._federation:
             self._federation.send_presence_to_destinations(
                 states=states,