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

Fix an invalid comparison of UserPresenceState to str #14393

Merged
merged 9 commits into from
Nov 16, 2022
1 change: 1 addition & 0 deletions changelog.d/14393.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in 1.58.0 where a user with presence state 'org.matrix.msc3026.busy' would mistakenly be set to 'online' when calling `/sync` or `/events` on a worker process.
2 changes: 1 addition & 1 deletion synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ async def user_syncing(
return _NullContextManager()

prev_state = await self.current_state_for_user(user_id)
if prev_state != PresenceState.BUSY:
if prev_state.state != PresenceState.BUSY:
# We set state here but pass ignore_status_msg = True as we don't want to
# cause the status message to be cleared.
# Note that this causes last_active_ts to be incremented which is not
Expand Down