Moved code that fill the contentsList of ChatMessage from MultipartChatModifier to ChatMessage itself

This commit is contained in:
Sylvain Berfini 2017-10-06 10:33:19 +02:00
parent df8aedecc3
commit 32e22abee2
2 changed files with 5 additions and 3 deletions

View file

@ -996,6 +996,11 @@ LinphoneReason ChatMessagePrivate::receive() {
MultipartChatMessageModifier mcmm;
mcmm.decode(q->getSharedFromThis(), &errorCode);
if (contents.size() == 0) {
// All previous modifiers only altered the internal content, let's fill the content list
contents.push_back(internalContent);
}
// ---------------------------------------
// End of message modification
// ---------------------------------------

View file

@ -40,9 +40,6 @@ ChatMessageModifier::Result MultipartChatMessageModifier::decode (shared_ptr<Cha
if (false) { // Multipart required
return ChatMessageModifier::Result::Done;
} else if (message->getContents().size() == 0) {
// All previous modifiers only altered the internal content, let's fill the content list because we're the last modifier to be called
message->addContent(message->getInternalContent());
}
return ChatMessageModifier::Result::Skipped;
}