Commit 3b64a06c authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed legacy getText method on ChatMessage

parent a705f8dd
......@@ -259,9 +259,7 @@ const string &ChatMessagePrivate::getText () {
cText = internalContent.getBodyAsString();
}
} else {
if (hasTextContent()) {
cText = getTextContent()->getBodyAsString();
} else if (!internalContent.isEmpty()) {
if (!internalContent.isEmpty()) {
cText = internalContent.getBodyAsString();
} else {
if (contents.size() > 0) {
......@@ -482,6 +480,12 @@ LinphoneReason ChatMessagePrivate::receive () {
// End of message modification
// ---------------------------------------
// Remove internal content as it is not needed anymore and will confuse some old methods like getText()
internalContent.setBody("");
internalContent.setContentType(ContentType(""));
// Also remove current step so we go through all modifiers if message is re-sent
currentRecvStep = ChatMessagePrivate::Step::None;
setState(ChatMessage::State::Delivered, false);
if (errorCode <= 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