From 591778510744bd47be920a8d61c7b3d46f258c5d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 13 Oct 2017 14:26:58 +0200 Subject: [PATCH] Add linphone_chat_message_send() API. --- include/linphone/api/c-chat-message.h | 9 ++++++++- include/linphone/api/c-chat-room.h | 7 ++++--- src/c-wrapper/api/c-chat-message.cpp | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h index 20103291a..4dabfcf8e 100644 --- a/include/linphone/api/c-chat-message.h +++ b/include/linphone/api/c-chat-message.h @@ -263,12 +263,19 @@ LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_download_file(LinphoneChatM */ LINPHONE_PUBLIC void linphone_chat_message_cancel_file_transfer(LinphoneChatMessage* msg); +/** + * Send a chat message. + * @param[in] msg LinphoneChatMessage object + */ +LINPHONE_PUBLIC void linphone_chat_message_send (LinphoneChatMessage *msg); + /** * Resend a chat message if it is in the 'not delivered' state for whatever reason. * @param[in] msg LinphoneChatMessage object + * @deprecated Use linphone_chat_message_send instead. * @donotwrap */ -LINPHONE_PUBLIC void linphone_chat_message_resend(LinphoneChatMessage *msg); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_resend(LinphoneChatMessage *msg); LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg); diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index 534c4265e..33bedd0c4 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -100,7 +100,7 @@ LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_room_get_peer_address(Linph /** * Send a message to peer member of this chat room. - * @deprecated Use linphone_chat_room_send_chat_message() instead. + * @deprecated Use linphone_chat_message_send() instead. * @param cr #LinphoneChatRoom object * @param msg message to be sent * @donotwrap @@ -113,7 +113,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_message(Linphon * @param msg #LinphoneChatMessage message to be sent * @param status_cb LinphoneChatMessageStateChangeCb status callback invoked when message is delivered or could not be delivered. May be NULL * @param ud user data for the status cb. - * @deprecated Use linphone_chat_room_send_chat_message() instead. + * @deprecated Use linphone_chat_message_send() instead. * @note The LinphoneChatMessage must not be destroyed until the the callback is called. * The LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application. * @donotwrap @@ -127,9 +127,10 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_message2(Linpho * The state of the message sending will be notified via the callbacks defined in the LinphoneChatMessageCbs object that can be obtained * by calling linphone_chat_message_get_callbacks(). * The LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application. + * @deprecated Use linphone_chat_message_send() instead. * @donotwrap */ -LINPHONE_PUBLIC void linphone_chat_room_send_chat_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_chat_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg); /** * Mark all messages of the conversation as read diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index e44853426..95910a1d3 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -264,6 +264,10 @@ void linphone_chat_message_cancel_file_transfer(LinphoneChatMessage *msg) { L_GET_CPP_PTR_FROM_C_OBJECT(msg)->cancelFileTransfer(); } +void linphone_chat_message_send (LinphoneChatMessage *msg) { + L_GET_CPP_PTR_FROM_C_OBJECT(msg)->send(); +} + void linphone_chat_message_resend(LinphoneChatMessage *msg) { L_GET_CPP_PTR_FROM_C_OBJECT(msg)->send(); }