1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(chatlog): update timestamp when db is slower than ack

* cannot invoke non-slot function
This commit is contained in:
Anthony Bilinski 2019-05-17 03:41:13 -07:00
parent 5f40ed8d8c
commit ca397aebbf
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,7 @@ void OfflineMsgEngine::completeMessage(QMap<ReceiptNum, Message>::iterator msgIt
if (QThread::currentThread() == QCoreApplication::instance()->thread()) { if (QThread::currentThread() == QCoreApplication::instance()->thread()) {
updateTimestamp(msgIt->chatMessage); updateTimestamp(msgIt->chatMessage);
} else { } 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); sentSavedMessages.erase(msgIt);
receivedReceipts.removeOne(msgIt.key()); receivedReceipts.removeOne(msgIt.key());

View File

@ -57,8 +57,10 @@ private:
private slots: private slots:
void completeMessage(QMap<ReceiptNum, Message>::iterator msgIt); void completeMessage(QMap<ReceiptNum, Message>::iterator msgIt);
private: private slots:
void updateTimestamp(ChatMessage::Ptr msg); void updateTimestamp(ChatMessage::Ptr msg);
private:
void checkForCompleteMessages(ReceiptNum receipt); void checkForCompleteMessages(ReceiptNum receipt);
QMutex mutex; QMutex mutex;