Skip to content
Snippets Groups Projects
Commit 27a5faa1 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

conversation: prevent clearing interaction cache for certain conversations

Change-Id: I65907e052015efeef066d6262e6f179a4e4a1644
parent 84f65ae0
Branches
No related tags found
No related merge requests found
...@@ -1333,12 +1333,14 @@ ConversationModel::clearInteractionsCache(const QString& convId) ...@@ -1333,12 +1333,14 @@ ConversationModel::clearInteractionsCache(const QString& convId)
try { try {
auto& conversation = pimpl_->conversations.at(conversationIdx); auto& conversation = pimpl_->conversations.at(conversationIdx);
if (!conversation.isRequest && !conversation.needsSyncing && conversation.isSwarm()) {
{ {
std::lock_guard<std::mutex> lk(pimpl_->interactionsLocks[convId]); std::lock_guard<std::mutex> lk(pimpl_->interactionsLocks[convId]);
conversation.interactions->clear(1); conversation.interactions->clear(1);
} }
conversation.allMessagesLoaded = false; conversation.allMessagesLoaded = false;
conversation.lastMessageUid = conversation.interactions->last().first; conversation.lastMessageUid = conversation.interactions->last().first;
}
} catch (const std::out_of_range& e) { } catch (const std::out_of_range& e) {
qDebug() << "can't find interaction from conversation: " << e.what(); qDebug() << "can't find interaction from conversation: " << e.what();
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment