diff --git a/src/persistence/offlinemsgengine.cpp b/src/persistence/offlinemsgengine.cpp index b7c375d7d..d59a44569 100644 --- a/src/persistence/offlinemsgengine.cpp +++ b/src/persistence/offlinemsgengine.cpp @@ -154,7 +154,7 @@ void OfflineMsgEngine::completeMessage(QMap::iterator msgIt if (QThread::currentThread() == QCoreApplication::instance()->thread()) { updateTimestamp(msgIt->chatMessage); } else { - QMetaObject::invokeMethod(this, "updateTimestamp", Qt::QueuedConnection, Q_ARG(ChatMessage::Ptr, msgIt->chatMessage)); + QMetaObject::invokeMethod(this, "updateTimestamp", Qt::BlockingQueuedConnection, Q_ARG(ChatMessage::Ptr, msgIt->chatMessage)); } sentSavedMessages.erase(msgIt); receivedReceipts.removeOne(msgIt.key()); diff --git a/src/persistence/offlinemsgengine.h b/src/persistence/offlinemsgengine.h index 2e044eade..8a1214de3 100644 --- a/src/persistence/offlinemsgengine.h +++ b/src/persistence/offlinemsgengine.h @@ -57,8 +57,10 @@ private: private slots: void completeMessage(QMap::iterator msgIt); -private: +private slots: void updateTimestamp(ChatMessage::Ptr msg); + +private: void checkForCompleteMessages(ReceiptNum receipt); QMutex mutex;