diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 339bc0f12..d2d1c5e88 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -3477,28 +3477,6 @@ uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t* chatlist, siz dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t* chatlist, size_t index, dc_chat_t* chat); -/** - * Create a chatlist summary item when the chatlist object is already unref()'d. - * - * This function is similar to dc_chatlist_get_summary(), however, - * it takes the chat ID and the message ID as returned by dc_chatlist_get_chat_id() and dc_chatlist_get_msg_id() - * as arguments. The chatlist object itself is not needed directly. - * - * This maybe useful if you convert the complete object into a different representation - * as done e.g. in the node-bindings. - * If you have access to the chatlist object in some way, using this function is not recommended, - * use dc_chatlist_get_summary() in this case instead. - * - * @memberof dc_context_t - * @param context The context object. - * @param chat_id The chat ID to get a summary for. - * @param msg_id The message ID to get a summary for. - * @return The summary as an dc_lot_t object, see dc_chatlist_get_summary() for details. - * Must be freed using dc_lot_unref(). NULL is never returned. - */ -dc_lot_t* dc_chatlist_get_summary2 (dc_context_t* context, uint32_t chat_id, uint32_t msg_id); - - /** * Helper function to get the associated context object. * diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 702329310..f874e593b 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -48,7 +48,6 @@ mod dc_array; mod lot; mod string; -use deltachat::chatlist::Chatlist; use self::string::*; @@ -2889,34 +2888,6 @@ pub unsafe extern "C" fn dc_chatlist_get_summary( }) } -#[no_mangle] -pub unsafe extern "C" fn dc_chatlist_get_summary2( - context: *mut dc_context_t, - chat_id: u32, - msg_id: u32, -) -> *mut dc_lot_t { - if context.is_null() { - eprintln!("ignoring careless call to dc_chatlist_get_summary2()"); - return ptr::null_mut(); - } - let ctx = &*context; - let msg_id = if msg_id == 0 { - None - } else { - Some(MsgId::new(msg_id)) - }; - let summary = block_on(Chatlist::get_summary2( - ctx, - ChatId::new(chat_id), - msg_id, - None, - )) - .context("get_summary2 failed") - .log_err(ctx) - .unwrap_or_default(); - Box::into_raw(Box::new(summary.into())) -} - #[no_mangle] pub unsafe extern "C" fn dc_chatlist_get_context( chatlist: *mut dc_chatlist_t, diff --git a/node/lib/context.ts b/node/lib/context.ts index b292e9e35..2962c73dd 100644 --- a/node/lib/context.ts +++ b/node/lib/context.ts @@ -345,13 +345,6 @@ export class Context extends EventEmitter { return binding.dcn_get_mime_headers(this.dcn_context, Number(messageId)) } - getChatlistItemSummary(chatId: number, messageId: number) { - debug(`getChatlistItemSummary ${chatId} ${messageId}`) - return new Lot( - binding.dcn_chatlist_get_summary2(this.dcn_context, chatId, messageId) - ) - } - getChatMessages(chatId: number, flags: number, marker1before: number) { debug(`getChatMessages ${chatId} ${flags} ${marker1before}`) return binding.dcn_get_chat_msgs( diff --git a/node/src/module.c b/node/src/module.c index da44376dc..df0ce7e6b 100644 --- a/node/src/module.c +++ b/node/src/module.c @@ -1792,28 +1792,6 @@ NAPI_METHOD(dcn_chatlist_get_summary) { return result; } -NAPI_METHOD(dcn_chatlist_get_summary2) { - NAPI_ARGV(3); - NAPI_DCN_CONTEXT(); - NAPI_ARGV_INT32(chat_id, 1); - NAPI_ARGV_INT32(message_id, 2); - - //TRACE("calling.."); - dc_lot_t* summary = dc_chatlist_get_summary2(dcn_context->dc_context, chat_id, message_id); - - napi_value result; - if (summary == NULL) { - NAPI_STATUS_THROWS(napi_get_null(env, &result)); - } else { - NAPI_STATUS_THROWS(napi_create_external(env, summary, - finalize_lot, - NULL, &result)); - } - //TRACE("done"); - - return result; -} - /** * dc_contact_t */ @@ -3511,7 +3489,6 @@ NAPI_INIT() { NAPI_EXPORT_FUNCTION(dcn_chatlist_get_cnt); NAPI_EXPORT_FUNCTION(dcn_chatlist_get_msg_id); NAPI_EXPORT_FUNCTION(dcn_chatlist_get_summary); - NAPI_EXPORT_FUNCTION(dcn_chatlist_get_summary2); /** * dc_contact_t