api!: deprecate get_next_media()

This commit is contained in:
link2xt
2023-10-03 15:17:34 +00:00
parent 2dd44d5f89
commit 7c4bcf9004
4 changed files with 9 additions and 0 deletions

View File

@@ -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 * Typically used to implement the "next" and "previous" buttons
* in a gallery or in a media player. * 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 * @memberof dc_context_t
* @param context The context object as returned from dc_context_new(). * @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. * @param msg_id The ID of the current message from which the next or previous message should be searched.

View File

@@ -1431,6 +1431,7 @@ pub unsafe extern "C" fn dc_get_chat_media(
} }
#[no_mangle] #[no_mangle]
#[allow(deprecated)]
pub unsafe extern "C" fn dc_get_next_media( pub unsafe extern "C" fn dc_get_next_media(
context: *mut dc_context_t, context: *mut dc_context_t,
msg_id: u32, msg_id: u32,

View File

@@ -1427,6 +1427,10 @@ impl CommandApi {
/// ///
/// one combined call for getting chat::get_next_media for both directions /// 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 /// 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( async fn get_neighboring_chat_media(
&self, &self,
account_id: u32, account_id: u32,

View File

@@ -2898,6 +2898,9 @@ pub enum Direction {
} }
/// Searches next/previous message based on the given message and list of types. /// 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( pub async fn get_next_media(
context: &Context, context: &Context,
curr_msg_id: MsgId, curr_msg_id: MsgId,