diff --git a/src/api/client/sync/v3/mod.rs b/src/api/client/sync/v3/mod.rs index 9d187de6..58219d59 100644 --- a/src/api/client/sync/v3/mod.rs +++ b/src/api/client/sync/v3/mod.rs @@ -9,6 +9,7 @@ use std::{ }; use axum::extract::State; +use axum_client_ip::InsecureClientIp; use conduwuit::{ Result, extract_variant, utils::{ @@ -180,6 +181,7 @@ type PresenceUpdates = HashMap; )] pub(crate) async fn sync_events_route( State(services): State, + InsecureClientIp(client_ip): InsecureClientIp, body: Ruma, ) -> Result> { let (sender_user, sender_device) = body.sender(); @@ -192,6 +194,12 @@ pub(crate) async fn sync_events_route( .await?; } + // Increment the "device last active" metadata + services + .users + .update_device_last_seen(sender_user, Some(sender_device), client_ip) + .await; + // Setup watchers, so if there's no response, we can wait for them let watcher = services.sync.watch(sender_user, sender_device);