Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add an early return when handling no-op presence updates. #14855

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14855.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add an early return when handling no-op presence updates.
5 changes: 5 additions & 0 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,11 @@ def send_presence_to_destinations(
# 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,
Expand Down