From 11f202f4efde038ed3e405b024a600ddca98624e Mon Sep 17 00:00:00 2001 From: Jason Little Date: Sun, 2 Jul 2023 23:32:11 -0500 Subject: [PATCH] Strip out setting presence state through tcp replication --- synapse/handlers/presence.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 0a219b796271..5357c7d57ec5 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -1085,38 +1085,16 @@ async def update_external_syncs_row( sync_time_msec: Time in ms when the user was last syncing """ async with self.external_sync_linearizer.queue(process_id): - prev_state = await self.current_state_for_user(user_id) - process_presence = self.external_process_to_current_syncs.setdefault( process_id, set() ) - updates = [] if is_syncing and user_id not in process_presence: - if prev_state.state == PresenceState.OFFLINE: - updates.append( - prev_state.copy_and_replace( - state=PresenceState.ONLINE, - last_active_ts=sync_time_msec, - last_user_sync_ts=sync_time_msec, - ) - ) - else: - updates.append( - prev_state.copy_and_replace(last_user_sync_ts=sync_time_msec) - ) process_presence.add(user_id) - elif user_id in process_presence: - updates.append( - prev_state.copy_and_replace(last_user_sync_ts=sync_time_msec) - ) if not is_syncing: process_presence.discard(user_id) - if updates: - await self._update_states(updates) - self.external_process_last_updated_ms[process_id] = self.clock.time_msec() async def update_external_syncs_clear(self, process_id: str) -> None: