summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-08-28 13:08:49 -0400
committerGitHub <noreply@github.com>2023-08-28 13:08:49 -0400
commit40901af5e096cb10ab69141875b071b4ea4ed1e0 (patch)
treeddc310741a9c98bda2435b848832f9e3be49bf35 /synapse/handlers/message.py
parentCombine logic about not overriding BUSY presence. (#16170) (diff)
downloadsynapse-40901af5e096cb10ab69141875b071b4ea4ed1e0.tar.xz
Pass the device ID around in the presence handler (#16171)
Refactoring to pass the device ID (in addition to the user ID) through
the presence handler (specifically the `user_syncing`, `set_state`,
and `bump_presence_active_time` methods and their replication
versions).
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 3184bfb047..4a15c76a7b 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -1921,7 +1921,10 @@ class EventCreationHandler:
                 # We don't want to block sending messages on any presence code. This
                 # matters as sometimes presence code can take a while.
                 run_as_background_process(
-                    "bump_presence_active_time", self._bump_active_time, requester.user
+                    "bump_presence_active_time",
+                    self._bump_active_time,
+                    requester.user,
+                    requester.device_id,
                 )
 
         async def _notify() -> None:
@@ -1958,10 +1961,10 @@ class EventCreationHandler:
         logger.info("maybe_kick_guest_users %r", current_state)
         await self.hs.get_room_member_handler().kick_guest_users(current_state)
 
-    async def _bump_active_time(self, user: UserID) -> None:
+    async def _bump_active_time(self, user: UserID, device_id: Optional[str]) -> None:
         try:
             presence = self.hs.get_presence_handler()
-            await presence.bump_presence_active_time(user)
+            await presence.bump_presence_active_time(user, device_id)
         except Exception:
             logger.exception("Error bumping presence active time")