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

This commit is contained in:
Sylvain Berfini 2017-11-07 10:23:16 +01:00
parent f18fcbdf2f
commit bcfa66e447
3 changed files with 5 additions and 2 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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) {