api: add JSON-RPC API is_sending_finished()

This commit is contained in:
link2xt
2026-09-12 14:29:23 +00:00
committed by l
parent 0b2051cda4
commit 44387f5e58
5 changed files with 66 additions and 0 deletions

View File

@@ -2775,6 +2775,15 @@ impl CommandApi {
.map(JsonrpcAppSource::from_core_type),
)
}
/// Returns true if all accounts have empty outgoing message queue.
///
/// This API is intended to be used by UIs
/// to request that operating system does not put the application in background
/// while there are still outgoing messages that are not sent out.
async fn is_sending_finished(&self) -> Result<bool> {
self.accounts.read().await.is_sending_finished().await
}
}
// Helper functions (to prevent code duplication)