mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
This should fix IMDNs & IsComposing being stored
This commit is contained in:
parent
758729ba11
commit
759ecda219
1 changed files with 13 additions and 19 deletions
|
|
@ -425,15 +425,7 @@ LinphoneReason ChatMessagePrivate::receive () {
|
|||
return reason;
|
||||
}
|
||||
|
||||
bool messageToBeStored = false;
|
||||
for (Content *c : contents) {
|
||||
if (c->getContentType() == ContentType::FileTransfer || c->getContentType() == ContentType::PlainText) {
|
||||
messageToBeStored = true;
|
||||
}
|
||||
}
|
||||
if (messageToBeStored) {
|
||||
store();
|
||||
}
|
||||
store();
|
||||
|
||||
return reason;
|
||||
}
|
||||
|
|
@ -552,13 +544,6 @@ 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) {
|
||||
|
|
@ -571,9 +556,7 @@ void ChatMessagePrivate::send () {
|
|||
|
||||
q->setImdnMessageId(op->get_call_id()); /* must be known at that time */
|
||||
|
||||
if (messageToBeStored) {
|
||||
store();
|
||||
}
|
||||
store();
|
||||
|
||||
if (call && linphone_call_get_op(call) == op) {
|
||||
/* In this case, chat delivery status is not notified, so unrefing chat message right now */
|
||||
|
|
@ -591,6 +574,17 @@ void ChatMessagePrivate::send () {
|
|||
void ChatMessagePrivate::store() {
|
||||
L_Q();
|
||||
|
||||
bool messageToBeStored = false;
|
||||
for (Content *c : contents) {
|
||||
ContentType contentType = c->getContentType();
|
||||
if (contentType == ContentType::FileTransfer || contentType == ContentType::PlainText || contentType.isFile()) {
|
||||
messageToBeStored = true;
|
||||
}
|
||||
}
|
||||
if (!messageToBeStored) {
|
||||
return;
|
||||
}
|
||||
|
||||
shared_ptr<ConferenceChatMessageEvent> eventLog = chatEvent.lock();
|
||||
if (eventLog) {
|
||||
q->getChatRoom()->getCore()->getPrivate()->mainDb->updateEvent(eventLog);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue