From b3d1d7f9bb15767e4bfcebf75661ed4dd7bc3d65 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 24 Nov 2017 14:19:39 +0100 Subject: [PATCH] Do not store outgoing IMDNs and IsComposing --- src/chat/chat-message/chat-message.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 8b9a27411..aa69c4a38 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -552,6 +552,13 @@ void ChatMessagePrivate::send () { } else msgOp->send_message(ContentType::PlainText.asString().c_str(), internalContent.getBodyAsString().c_str()); + bool messageToBeStored = false; + for (Content *c : contents) { + if (c->getContentType() == ContentType::FileTransfer || c->getContentType() == ContentType::PlainText) { + messageToBeStored = true; + } + } + for (Content *content : contents) { // Restore FileContents and remove FileTransferContents if (content->getContentType() == ContentType::FileTransfer) { @@ -564,7 +571,9 @@ void ChatMessagePrivate::send () { q->setImdnMessageId(op->get_call_id()); /* must be known at that time */ - store(); + if (messageToBeStored) { + store(); + } if (call && linphone_call_get_op(call) == op) { /* In this case, chat delivery status is not notified, so unrefing chat message right now */