fix: Don't ping presence for devices which claim to be offline

Fixes https://github.com/gomuks/gomuks/issues/722.

Reviewed-by: Ginger <ginger@gingershaped.computer>
This commit is contained in:
timedout authored and Ginger committed 2026-05-28 09:38:32 -04:00
1 parent d7a51c7107
commit 1faa09b6ce
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -0,0 +1 @@
Devices which set their presence as "offline" will no longer be considered for presence updates. Contributed by @timedout.
+2 -1
View File
@@ -34,6 +34,7 @@
},
assign,
events::presence::{PresenceEvent, PresenceEventContent},
presence::PresenceState,
serde::Raw,
};
use service::{
@@ -185,7 +186,7 @@ pub(crate) async fn sync_events_route(
let sender_device = body.identity.expect_sender_device()?;
// Presence update
if services.config.allow_local_presence {
if services.config.allow_local_presence && body.set_presence != PresenceState::Offline {
services
.presence
.ping_presence(sender_user, &body.body.set_presence)