mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Add API to get next fresh message
Rust: Context.get_next_fresh_msg() C: dc_get_next_fresh_msg() JSON-RPC: get_next_fresh_msg method
This commit is contained in:
@@ -372,6 +372,15 @@ impl CommandApi {
|
||||
.collect())
|
||||
}
|
||||
|
||||
/// Returns the message ID of the oldest fresh message.
|
||||
///
|
||||
/// If there are no such messages, waits until there is one.
|
||||
async fn get_next_fresh_msg(&self, account_id: u32) -> Result<u32> {
|
||||
let ctx = self.get_context(account_id).await?;
|
||||
let msg_id = ctx.get_next_fresh_msg().await?;
|
||||
Ok(msg_id.to_u32())
|
||||
}
|
||||
|
||||
/// Get the number of _fresh_ messages in a chat.
|
||||
/// Typically used to implement a badge with a number in the chatlist.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user