optimise resetting all user presences

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2025-01-10 23:51:08 -05:00
parent fde1b94e26
commit 8c18481d1d
No known key found for this signature in database
4 changed files with 40 additions and 28 deletions

View file

@ -123,13 +123,10 @@ impl Services {
.start()
.await?;
// clear online statuses
if self.server.config.allow_local_presence {
_ = self.presence.unset_all_presence().await;
}
// set the server user as online
// reset dormant online/away statuses to offline, and set the server user as
// online
if self.server.config.allow_local_presence && !self.db.is_read_only() {
self.presence.unset_all_presence().await;
_ = self
.presence
.ping_presence(&self.globals.server_user, &ruma::presence::PresenceState::Online)