From 7c4bcf9004f7ec3d9e1d2c12862adc0f2b8d080e Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 3 Oct 2023 15:17:34 +0000 Subject: [PATCH] api!: deprecate `get_next_media()` --- deltachat-ffi/deltachat.h | 1 + deltachat-ffi/src/lib.rs | 1 + deltachat-jsonrpc/src/api/mod.rs | 4 ++++ src/chat.rs | 3 +++ 4 files changed, 9 insertions(+) diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 1ef60960d..9a064acf2 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -1481,6 +1481,7 @@ dc_array_t* dc_get_chat_media (dc_context_t* context, uint32_t ch * Typically used to implement the "next" and "previous" buttons * in a gallery or in a media player. * + * @deprecated Deprecated 2023-10-03, use dc_get_chat_media() and navigate the returned array instead. * @memberof dc_context_t * @param context The context object as returned from dc_context_new(). * @param msg_id The ID of the current message from which the next or previous message should be searched. diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 42ebf06b3..86d142355 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -1431,6 +1431,7 @@ pub unsafe extern "C" fn dc_get_chat_media( } #[no_mangle] +#[allow(deprecated)] pub unsafe extern "C" fn dc_get_next_media( context: *mut dc_context_t, msg_id: u32, diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index 0b9816390..bbbf1fdf4 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -1427,6 +1427,10 @@ impl CommandApi { /// /// one combined call for getting chat::get_next_media for both directions /// the manual chat::get_next_media in only one direction is not exposed by the jsonrpc yet + /// + /// Deprecated 2023-10-03, use `get_chat_media` method + /// and navigate the returned array instead. + #[allow(deprecated)] async fn get_neighboring_chat_media( &self, account_id: u32, diff --git a/src/chat.rs b/src/chat.rs index c131fd1e9..70025f40f 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2898,6 +2898,9 @@ pub enum Direction { } /// Searches next/previous message based on the given message and list of types. +/// +/// Deprecated since 2023-10-03. +#[deprecated(note = "use `get_chat_media` instead")] pub async fn get_next_media( context: &Context, curr_msg_id: MsgId,