diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h index 8196cecc4..e487a3b5f 100644 --- a/include/linphone/api/c-chat-message.h +++ b/include/linphone/api/c-chat-message.h @@ -135,6 +135,7 @@ LINPHONE_PUBLIC void linphone_chat_message_set_content_type(LinphoneChatMessage /** * Get text part of this message * @return text or NULL if no text. + * @deprecated use getTextContent() instead */ LINPHONE_PUBLIC const char* linphone_chat_message_get_text(LinphoneChatMessage* msg); diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index b321bb286..b33d43fff 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -81,7 +81,7 @@ public: std::string getSalCustomHeaderValue(const std::string& name); // ----------------------------------------------------------------------------- - // Methods only used for C wrapper + // Methods only used for C wrapper, to be removed some day... // ----------------------------------------------------------------------------- const ContentType &getContentType(); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index d673e8466..b9b1138b8 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -187,7 +187,9 @@ const string &ChatMessagePrivate::getText () { cText = internalContent.getBodyAsString(); } } else { - if (!internalContent.isEmpty()) { + if (hasTextContent()) { + cText = getTextContent.getBodyAsString(); + } else if (!internalContent.isEmpty()) { cText = internalContent.getBodyAsString(); } else { if (contents.size() > 0) {