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

@ -46,11 +46,7 @@ impl Presence {
users: &users::Service,
) -> PresenceEvent {
let now = utils::millis_since_unix_epoch();
let last_active_ago = if self.currently_active {
None
} else {
Some(UInt::new_saturating(now.saturating_sub(self.last_active_ts)))
};
let last_active_ago = Some(UInt::new_saturating(now.saturating_sub(self.last_active_ts)));
PresenceEvent {
sender: user_id.to_owned(),