fix for outgoing messages

This commit is contained in:
DenioD
2020-06-03 22:15:46 +02:00
parent e39c19f75e
commit b9a4aa8889

View File

@@ -886,8 +886,9 @@ void Controller::refreshTransactions() {
// First, check if there's outgoing metadata // First, check if there's outgoing metadata
if (!it["outgoing_metadata"].is_null()) { if (!it["outgoing_metadata"].is_null()) {
for (auto o: it["outgoing_metadata"].get<json::array_t>()) { for (auto o: it["outgoing_metadata"].get<json::array_t>())
{
// if (chatModel->getCidByTx(txid) == QString("0xdeadbeef")){
QString address; QString address;
address = QString::fromStdString(o["address"]); address = QString::fromStdString(o["address"]);
@@ -966,7 +967,7 @@ void Controller::refreshTransactions() {
/////We need to filter out Memos smaller then the ciphertext size, or it will dump /////We need to filter out Memos smaller then the ciphertext size, or it will dump
if ((memo.startsWith("{") == false) && (headerbytes > 0)) if ((memo.startsWith("{") == false) && (headerbytes.length() > 20))
{ {
QString passphrase = main->getPassword(); QString passphrase = main->getPassword();
@@ -1053,12 +1054,10 @@ void Controller::refreshTransactions() {
} }
std::string decryptedMemo(reinterpret_cast<char*>(decrypted),MESSAGE1_LEN); std::string decryptedMemo(reinterpret_cast<char*>(decrypted),MESSAGE1_LEN);
QString memodecrypt;
/////Now we can convert it to QString /////Now we can convert it to QString
memodecrypt = QString::fromUtf8( decryptedMemo.data(), decryptedMemo.size()); QString memodecrypt = QString::fromUtf8( decryptedMemo.data(), decryptedMemo.size());
//////////////Give us the output of the decrypted message as debug to see if it was successfully //////////////Give us the output of the decrypted message as debug to see if it was successfully
@@ -1083,7 +1082,8 @@ void Controller::refreshTransactions() {
updateUIBalances(); updateUIBalances();
}else{ }
/*else{
ChatItem item = ChatItem( ChatItem item = ChatItem(
@@ -1102,12 +1102,17 @@ void Controller::refreshTransactions() {
); );
DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item); DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item);
updateUIBalances(); updateUIBalances();
} }*/
} }
items.push_back(TransactionItemDetail{address, amount, memo}); items.push_back(TransactionItemDetail{address, amount, memo});
total_amount = total_amount + amount; total_amount = total_amount + amount;
} // }else{
// }
// }
}
{ {
QList<QString> addresses; QList<QString> addresses;