summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2021-02-18 14:03:43 +0000
committerRichard van der Hoff <richard@matrix.org>2021-02-18 14:03:43 +0000
commit1f507c25154a8d88fb57d7e94b5a7693901dc810 (patch)
treed580add3bc18df87b5c4d7d7953a4eb329c39d8a /synapse/handlers/presence.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentRedirect redirect requests if they arrive on the wrong URI (diff)
downloadsynapse-1f507c25154a8d88fb57d7e94b5a7693901dc810.tar.xz
Merge branch 'rav/fix_cookie_path' into matrix-org-hotfixes
Merge the cookie fix to hotfixes
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py

index 7ba22d511f..fb85b19770 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py
@@ -349,10 +349,13 @@ class PresenceHandler(BasePresenceHandler): [self.user_to_current_state[user_id] for user_id in unpersisted] ) - async def _update_states(self, new_states): + async def _update_states(self, new_states: Iterable[UserPresenceState]) -> None: """Updates presence of users. Sets the appropriate timeouts. Pokes the notifier and federation if and only if the changed presence state should be sent to clients/servers. + + Args: + new_states: The new user presence state updates to process. """ now = self.clock.time_msec() @@ -368,7 +371,7 @@ class PresenceHandler(BasePresenceHandler): new_states_dict = {} for new_state in new_states: new_states_dict[new_state.user_id] = new_state - new_state = new_states_dict.values() + new_states = new_states_dict.values() for new_state in new_states: user_id = new_state.user_id @@ -657,17 +660,6 @@ class PresenceHandler(BasePresenceHandler): self._push_to_remotes(states) - async def notify_for_states(self, state, stream_id): - parties = await get_interested_parties(self.store, [state]) - room_ids_to_states, users_to_states = parties - - self.notifier.on_new_event( - "presence_key", - stream_id, - rooms=room_ids_to_states.keys(), - users=[UserID.from_string(u) for u in users_to_states], - ) - def _push_to_remotes(self, states): """Sends state updates to remote servers.