presence refactor

This commit is contained in:
dasha_uwu
2025-09-09 18:12:21 +05:00
committed by Jason Volk
parent fe46755418
commit e0169e3dca
6 changed files with 77 additions and 88 deletions

View File

@@ -125,20 +125,15 @@ pub(crate) async fn sync_events_route(
) -> Result<sync_events::v3::Response, RumaResponse<UiaaResponse>> {
let (sender_user, sender_device) = body.sender();
// Presence update
if services.config.allow_local_presence {
services
.presence
.ping_presence(sender_user, &body.body.set_presence)
.await
.log_err()
.ok();
services
.presence
.maybe_ping_presence(sender_user, &body.body.set_presence)
.await
.log_err()
.ok();
// Record user as actively syncing for push suppression heuristic.
if services.config.suppress_push_when_active {
services.presence.note_sync(sender_user).await;
}
}
// Record user as actively syncing for push suppression heuristic.
services.presence.note_sync(sender_user).await;
let mut since = body
.body