diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b7dca8d..c319efbb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ - ci: add github ci action to upload it to our download server automaticaly on realease ### Fixes - +- jsonrpc: fix daymarkers ## 1.95.0 diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index 037e2ad2d..6950789ea 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -6,6 +6,7 @@ use deltachat::{ }, chatlist::Chatlist, config::Config, + constants::DC_MSG_ID_DAYMARKER, contact::{may_be_valid_addr, Contact, ContactId}, context::get_info, message::{delete_msgs, get_msg_info, markseen_msgs, Message, MessageState, MsgId, Viewtype}, @@ -604,6 +605,10 @@ impl CommandApi { markseen_msgs(&ctx, msg_ids.into_iter().map(MsgId::new).collect()).await } + /// get ids of messages for a chat + /// (this api is similar to the cffi api, because it's still used that way by desktop) + /// + /// returns list with message ids and daymarkers (DC_MSG_ID_DAYMARKER = 9) if daymarkers are active async fn message_list_get_message_ids( &self, account_id: u32, @@ -614,9 +619,9 @@ impl CommandApi { let msg = get_chat_msgs(&ctx, ChatId::new(chat_id), flags).await?; Ok(msg .iter() - .filter_map(|chat_item| match chat_item { - deltachat::chat::ChatItem::Message { msg_id } => Some(msg_id.to_u32()), - _ => None, + .map(|chat_item| match chat_item { + deltachat::chat::ChatItem::Message { msg_id } => msg_id.to_u32(), + deltachat::chat::ChatItem::DayMarker { .. } => DC_MSG_ID_DAYMARKER, }) .collect()) } diff --git a/deltachat-jsonrpc/typescript/generated/client.ts b/deltachat-jsonrpc/typescript/generated/client.ts index 9b28600ae..4954c85e7 100644 --- a/deltachat-jsonrpc/typescript/generated/client.ts +++ b/deltachat-jsonrpc/typescript/generated/client.ts @@ -385,7 +385,12 @@ export class RawClient { return (this._transport.request('markseen_msgs', [accountId, msgIds] as RPC.Params)) as Promise; } - + /** + * get ids of messages for a chat + * (this api is similar to the cffi api, because it's still used that way by desktop) + * + * returns list with message ids and daymarkers (DC_MSG_ID_DAYMARKER = 9) if daymarkers are active + */ public messageListGetMessageIds(accountId: T.U32, chatId: T.U32, flags: T.U32): Promise<(T.U32)[]> { return (this._transport.request('message_list_get_message_ids', [accountId, chatId, flags] as RPC.Params)) as Promise<(T.U32)[]>; }