mark the server user bot as online/offline on shutdown/startup
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
@@ -123,6 +123,14 @@ impl Services {
|
||||
.start()
|
||||
.await?;
|
||||
|
||||
// set the server user as online
|
||||
if self.server.config.allow_local_presence {
|
||||
_ = self
|
||||
.presence
|
||||
.ping_presence(&self.globals.server_user, &ruma::presence::PresenceState::Online)
|
||||
.await;
|
||||
}
|
||||
|
||||
debug_info!("Services startup complete.");
|
||||
Ok(Arc::clone(self))
|
||||
}
|
||||
@@ -130,6 +138,14 @@ 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
|
||||
.presence
|
||||
.ping_presence(&self.globals.server_user, &ruma::presence::PresenceState::Offline)
|
||||
.await;
|
||||
}
|
||||
|
||||
self.interrupt();
|
||||
if let Some(manager) = self.manager.lock().await.as_ref() {
|
||||
manager.stop().await;
|
||||
|
||||
Reference in New Issue
Block a user