diff --git a/src/database/rooms/edus.rs b/src/database/rooms/edus.rs index bf0cdfc..29edc2a 100644 --- a/src/database/rooms/edus.rs +++ b/src/database/rooms/edus.rs @@ -386,8 +386,6 @@ impl RoomEdus { .take_while(|(_, timestamp)| current_timestamp - timestamp > 5 * 60_000) // 5 Minutes { - self.userid_lastpresenceupdate.remove(&user_id_bytes)?; - // Send new presence events to set the user offline let count = globals.next_count()?.to_be_bytes(); let user_id = utils::string_from_bytes(&user_id_bytes) @@ -421,6 +419,11 @@ impl RoomEdus { .expect("PresenceEvent can be serialized"), )?; } + + self.userid_lastpresenceupdate.insert( + &user_id.to_string().as_bytes(), + &utils::millis_since_unix_epoch().to_be_bytes(), + )?; } Ok(())