Move server user presence handling to presence service

This commit is contained in:
dasha_uwu
2025-08-24 02:39:28 +05:00
parent f51a7b12b5
commit bcd4f80149
2 changed files with 16 additions and 18 deletions

View File

@@ -160,16 +160,6 @@ impl Services {
.start()
.await?;
// 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)
.await;
}
debug_info!("Services startup complete.");
Ok(Arc::clone(self))
@@ -178,14 +168,6 @@ impl Services {
pub async fn stop(&self) {
info!("Shutting down services...");
// set the server user as offline
if self.server.config.allow_local_presence && !self.db.is_read_only() {
_ = self
.presence
.ping_presence(&self.globals.server_user, &ruma::presence::PresenceState::Offline)
.await;
}
self.interrupt().await;
if let Some(manager) = self.manager.lock().await.as_ref() {
manager.stop().await;