From 95638a25fd46c0c3619b95d36a6bdb8b6e353ddd Mon Sep 17 00:00:00 2001 From: Strider <404@127.0.0.1.com> Date: Fri, 1 May 2020 19:18:07 +0200 Subject: [PATCH] update// map read --- src/chatmodel.cpp | 5 +++++ src/controller.cpp | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index c01b84c..c4b7678 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -145,6 +145,11 @@ void ChatModel::addCid(QString tx, QString cid) QString ChatModel::getCidByTx(QString tx) { + for(auto& pair : this->cidMap) + { + qDebug() << "TXID=" << pair.first << " CID=" << pair.second; + } + if(this->cidMap.count(tx) > 0) { return this->cidMap[tx]; diff --git a/src/controller.cpp b/src/controller.cpp index 5952201..0845a16 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -943,8 +943,13 @@ void Controller::refreshTransactions() { if (memo.startsWith("{")) { cid = memo.mid(14,36); chatModel->addCid(txid, cid); - }else{ cid = "";} - + }else{ + if(chatModel->getCidByTx(txid) != QString("0xdeadbeef")) + cid = chatModel->getCidByTx(txid); + + cid = ""; + } + ChatItem item = ChatItem( datetime, address, @@ -953,9 +958,7 @@ void Controller::refreshTransactions() { cid, // we have to set the cid here, its included in the headermemo txid ); - qDebug()<addMessage(item); }