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

@@ -28,7 +28,7 @@ pub(crate) async fn create_typing_event_route(
match body.state {
| Typing::Yes(duration) => {
let duration = utils::clamp(
let duration = Ord::clamp(
duration
.as_millis()
.try_into()
@@ -64,12 +64,10 @@ pub(crate) async fn create_typing_event_route(
}
// ping presence
if services.config.allow_local_presence {
services
.presence
.ping_presence(&body.user_id, &ruma::presence::PresenceState::Online)
.await?;
}
services
.presence
.maybe_ping_presence(&body.user_id, &ruma::presence::PresenceState::Online)
.await?;
Ok(create_typing_event::v3::Response {})
}