@@ -93,7 +93,9 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListWidget *view)
|
|||||||
myDateTime.setTime_t(c.second.getTimestamp());
|
myDateTime.setTime_t(c.second.getTimestamp());
|
||||||
|
|
||||||
//////Render only Memos for selected contacts. Do not render empty Memos //// Render only memos where cid=cid
|
//////Render only Memos for selected contacts. Do not render empty Memos //// Render only memos where cid=cid
|
||||||
if ((ui->ContactZaddr->text().trimmed() == c.second.getAddress()) && (c.second.getMemo().startsWith("{") == false) && (c.second.getMemo().isEmpty() == false)) {
|
|
||||||
|
///
|
||||||
|
if ((ui->ContactZaddr->text().trimmed() == c.second.getAddress()) && (c.second.getMemo().startsWith("{") == false) && (c.second.getMemo().isEmpty() == false)) {
|
||||||
// if (c.second.getMemo.find())
|
// if (c.second.getMemo.find())
|
||||||
line += QString("[") + myDateTime.toString("dd.MM.yyyy hh:mm:ss ") + QString("] ");
|
line += QString("[") + myDateTime.toString("dd.MM.yyyy hh:mm:ss ") + QString("] ");
|
||||||
line += QString("<") + QString("Outgoing") + QString("> :\n");
|
line += QString("<") + QString("Outgoing") + QString("> :\n");
|
||||||
@@ -102,7 +104,7 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListWidget *view)
|
|||||||
line ="";
|
line ="";
|
||||||
|
|
||||||
////////////////////////////////// Todo : Render green checkmark for contacts if cid = cid - We have to search for cid in txid/cid list
|
////////////////////////////////// Todo : Render green checkmark for contacts if cid = cid - We have to search for cid in txid/cid list
|
||||||
QString cid = c.second.getCid();
|
// QString cid = c.second.getCid();
|
||||||
|
|
||||||
}else{}
|
}else{}
|
||||||
|
|
||||||
@@ -170,7 +172,7 @@ Tx MainWindow::createTxFromChatPage() {
|
|||||||
|
|
||||||
tx.toAddrs.push_back(ToFields{addr, amt, hmemo}) ;
|
tx.toAddrs.push_back(ToFields{addr, amt, hmemo}) ;
|
||||||
|
|
||||||
tx.toAddrs.push_back( ToFields{addr, amt, memo});
|
tx.toAddrs.push_back(ToFields{addr, amt, memo});
|
||||||
|
|
||||||
qDebug() << "pushback chattx";
|
qDebug() << "pushback chattx";
|
||||||
} }
|
} }
|
||||||
@@ -249,7 +251,7 @@ void MainWindow::sendChatButton() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Force a UI update so we get the unconfirmed Tx
|
// Force a UI update so we get the unconfirmed Tx
|
||||||
rpc->refresh(true);
|
// rpc->refresh(true);
|
||||||
ui->memoTxtChat->clear();
|
ui->memoTxtChat->clear();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -895,26 +895,27 @@ void Controller::refreshTransactions() {
|
|||||||
|
|
||||||
items.push_back(TransactionItemDetail{address, amount, memo});
|
items.push_back(TransactionItemDetail{address, amount, memo});
|
||||||
total_amount = total_amount + amount;
|
total_amount = total_amount + amount;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// {
|
{
|
||||||
|
QList<QString> addresses;
|
||||||
|
for (auto item : items) {
|
||||||
// Concat all the addresses
|
// Concat all the addresses
|
||||||
|
if (item.amount == 0) {
|
||||||
|
|
||||||
// QList<QString> addresses;
|
}else{
|
||||||
// for (auto item : items) {
|
|
||||||
|
|
||||||
// addresses.push_back(item.address);
|
|
||||||
|
|
||||||
|
|
||||||
|
addresses.push_back(item.address); }
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
txdata.push_back(TransactionItem{
|
txdata.push_back(TransactionItem{
|
||||||
"send", datetime, address, txid,confirmations, items
|
"send", datetime, address, txid,confirmations, items
|
||||||
});
|
});
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Incoming Transaction
|
// Incoming Transaction
|
||||||
address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"]));
|
address = (it["address"].is_null() ? "" : QString::fromStdString(it["address"]));
|
||||||
@@ -925,18 +926,25 @@ void Controller::refreshTransactions() {
|
|||||||
memo = QString::fromStdString(it["memo"]);
|
memo = QString::fromStdString(it["memo"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
items.push_back(TransactionItemDetail{
|
||||||
|
address,
|
||||||
|
CAmount::fromqint64(it["amount"].get<json::number_integer_t>()),
|
||||||
|
memo
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
TransactionItem tx{
|
TransactionItem tx{
|
||||||
"Receive", datetime, address, txid,confirmations, items
|
"Receive", datetime, address, txid,confirmations, items
|
||||||
};
|
};
|
||||||
|
|
||||||
txdata.push_back(tx);
|
txdata.push_back(tx);
|
||||||
|
|
||||||
QString cid;
|
QString cid = "";
|
||||||
if (memo.startsWith("{")) {
|
// if (memo.startsWith("{")) {
|
||||||
|
|
||||||
cid = memo.mid(14,36);
|
// cid = memo.mid(14,36);
|
||||||
|
|
||||||
}else{ cid = "";}
|
// }else{ cid = "";}
|
||||||
|
|
||||||
ChatItem item = ChatItem(
|
ChatItem item = ChatItem(
|
||||||
datetime,
|
datetime,
|
||||||
@@ -948,13 +956,9 @@ void Controller::refreshTransactions() {
|
|||||||
);
|
);
|
||||||
qDebug()<<cid;
|
qDebug()<<cid;
|
||||||
qDebug()<<txid;
|
qDebug()<<txid;
|
||||||
|
qDebug()<<memo;
|
||||||
chatModel->addMessage(item);
|
chatModel->addMessage(item);
|
||||||
|
|
||||||
items.push_back(TransactionItemDetail{
|
|
||||||
address,
|
|
||||||
CAmount::fromqint64(it["amount"].get<json::number_integer_t>()),
|
|
||||||
memo
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -979,6 +983,7 @@ void Controller::refreshTransactions() {
|
|||||||
chatModel->renderChatBox(ui, ui->listChatMemo);
|
chatModel->renderChatBox(ui, ui->listChatMemo);
|
||||||
refreshContacts(
|
refreshContacts(
|
||||||
ui->listContactWidget
|
ui->listContactWidget
|
||||||
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -986,6 +991,7 @@ void Controller::refreshTransactions() {
|
|||||||
void Controller::refreshChat(QListWidget *listWidget)
|
void Controller::refreshChat(QListWidget *listWidget)
|
||||||
{
|
{
|
||||||
chatModel->renderChatBox(ui, listWidget);
|
chatModel->renderChatBox(ui, listWidget);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::refreshContacts(QListWidget *listWidget)
|
void Controller::refreshContacts(QListWidget *listWidget)
|
||||||
|
|||||||
Reference in New Issue
Block a user