Reduce number of separate sources of truth for presence disabled-ness

Instead of checking if we should update every time we want to update,
call the updater every time and decide internally.
This commit is contained in:
K900 2024-04-03 16:57:12 +03:00 committed by June
parent 34fe7b7369
commit 8134dd9151
4 changed files with 29 additions and 26 deletions

View file

@ -171,11 +171,9 @@ async fn sync_helper(
// bool = caching allowed
) -> Result<(sync_events::v3::Response, bool), Error> {
// Presence update
if services().globals.allow_local_presence() {
services()
.presence
.ping_presence(&sender_user, body.set_presence)?;
}
services()
.presence
.ping_presence(&sender_user, body.set_presence)?;
// Setup watchers, so if there's no response, we can wait for them
let watcher = services().globals.watch(&sender_user, &sender_device);