update// map read

This commit is contained in:
Strider
2020-05-01 19:18:07 +02:00
parent 498fca3fd6
commit 95638a25fd
2 changed files with 13 additions and 5 deletions

View File

@@ -145,6 +145,11 @@ void ChatModel::addCid(QString tx, QString cid)
QString ChatModel::getCidByTx(QString tx) QString ChatModel::getCidByTx(QString tx)
{ {
for(auto& pair : this->cidMap)
{
qDebug() << "TXID=" << pair.first << " CID=" << pair.second;
}
if(this->cidMap.count(tx) > 0) if(this->cidMap.count(tx) > 0)
{ {
return this->cidMap[tx]; return this->cidMap[tx];

View File

@@ -943,8 +943,13 @@ void Controller::refreshTransactions() {
if (memo.startsWith("{")) { if (memo.startsWith("{")) {
cid = memo.mid(14,36); cid = memo.mid(14,36);
chatModel->addCid(txid, cid); chatModel->addCid(txid, cid);
}else{ cid = "";} }else{
if(chatModel->getCidByTx(txid) != QString("0xdeadbeef"))
cid = chatModel->getCidByTx(txid);
cid = "";
}
ChatItem item = ChatItem( ChatItem item = ChatItem(
datetime, datetime,
address, address,
@@ -953,9 +958,7 @@ void Controller::refreshTransactions() {
cid, // we have to set the cid here, its included in the headermemo cid, // we have to set the cid here, its included in the headermemo
txid txid
); );
qDebug()<<cid; qDebug()<< "Message CID: " << cid;
qDebug()<<txid;
qDebug()<<memo;
chatModel->addMessage(item); chatModel->addMessage(item);
} }