fix: presence timer not working

This commit is contained in:
Holger Huo 2025-01-08 17:57:12 +08:00 committed by strawberry
parent 0074f903d8
commit 6f15c9b3f4
3 changed files with 24 additions and 12 deletions

View file

@ -82,14 +82,19 @@ pub(crate) async fn get_presence_route(
presence.content.status_msg
};
let last_active_ago = match presence.content.currently_active {
| Some(true) => None,
| _ => presence
.content
.last_active_ago
.map(|millis| Duration::from_millis(millis.into())),
};
Ok(get_presence::v3::Response {
// TODO: Should ruma just use the presenceeventcontent type here?
status_msg,
currently_active: presence.content.currently_active,
last_active_ago: presence
.content
.last_active_ago
.map(|millis| Duration::from_millis(millis.into())),
last_active_ago,
presence: presence.content.presence,
})
} else {