Commit bcfa66e4 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Deprecated getText() on ChatMessage + attempt to fix getText()

parent f18fcbdf
......@@ -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);
......
......@@ -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();
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment