...
 
Commits (3)
......@@ -103,6 +103,13 @@ LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_from_address(Li
*/
LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_to_address(LinphoneChatMessage* msg);
/**
* Get destination size of file of the message
* @param[in] message #LinphoneChatMessage obj
* @return the size of file of the message (0 if none)
*/
LINPHONE_PUBLIC size_t linphone_chat_message_get_file_size(const LinphoneChatMessage *msg);
/**
* Get the content type of a chat message.
* @param[in] message LinphoneChatMessage object
......
......@@ -275,6 +275,13 @@ void * linphone_chat_message_get_message_state_changed_cb_user_data(LinphoneChat
// Structure has changed, hard to keep the behavior
// =============================================================================
size_t linphone_chat_message_get_file_size(const LinphoneChatMessage *msg) {
if (L_GET_PRIVATE_FROM_C_OBJECT(msg)->hasFileTransferContent())
return static_cast<const LinphonePrivate::FileTransferContent *>(L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferContent())->getFileSize();
return 0;
}
const char *linphone_chat_message_get_content_type(LinphoneChatMessage *msg) {
msg->cache.contentType = L_GET_PRIVATE_FROM_C_OBJECT(msg)->getContentType().asString();
return L_STRING_TO_C(msg->cache.contentType);
......