fix: send presence updates when going offline

remaining bug: conduit sends presence updates every 5 minutes even if
the user is already offline
merge-requests/11/head
Timo Kösters 4 years ago
parent b4818716b8
commit d45d033bf1
No known key found for this signature in database
GPG Key ID: 24DA7517711A2BA4

@ -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(())

Loading…
Cancel
Save