mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +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:
@@ -1243,6 +1243,20 @@ pub unsafe extern "C" fn dc_get_fresh_msgs(
|
||||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_get_next_fresh_msg(context: *mut dc_context_t) -> u32 {
|
||||
if context.is_null() {
|
||||
eprintln!("ignoring careless call to dc_get_next_fresh_msg()");
|
||||
return 0;
|
||||
}
|
||||
let ctx = &*context;
|
||||
|
||||
block_on(ctx.get_next_fresh_msg())
|
||||
.log_err(ctx, "Failed to get next fresh message")
|
||||
.unwrap_or_default()
|
||||
.to_u32()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_marknoticed_chat(context: *mut dc_context_t, chat_id: u32) {
|
||||
if context.is_null() {
|
||||
|
||||
Reference in New Issue
Block a user