update// map read
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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()<<cid;
|
||||
qDebug()<<txid;
|
||||
qDebug()<<memo;
|
||||
qDebug()<< "Message CID: " << cid;
|
||||
chatModel->addMessage(item);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user