Skip to content

Commit

Permalink
show chatitems only one time #142
Browse files Browse the repository at this point in the history
  • Loading branch information
DenioD committed Jun 21, 2020
1 parent 969b79a commit 515d47d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/Model/ChatItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ QString ChatItem::toChatLine()
QString lock;
QString money;
QString moneyText;
QString moneyTextRequest;
myDateTime.setTime_t(_timestamp);

if (_notarize == true)
Expand All @@ -177,7 +178,7 @@ QString ChatItem::toChatLine()
{

lock = "<b> <img src=':/icons/res/lock_green.png'><b>";
}
}else{}

if (_memo.startsWith("Money transaction of :"))
{
Expand All @@ -192,28 +193,28 @@ QString ChatItem::toChatLine()

}
}else{money = "";
moneyText = ""; }
moneyText = ""; }

if (_memo.startsWith("Request of :"))
{
if (_outgoing == true)
{

moneyText = QString("<p> Outgoing Hush Request </p>") + QString("<b> <img src=':/icons/res/money-outgoing.png'><b>");
moneyTextRequest = QString("<p> Outgoing Hush Request </p>") + QString("<b> <img src=':/icons/res/money-outgoing.png'><b>");
}else{


moneyText = QString("<p> Incoming Hush Request </p>") + QString("<b> <img src=':/icons/res/money-mouth.png'><b>");
moneyTextRequest = QString("<p> Incoming Hush Request </p>") + QString("<b> <img src=':/icons/res/money-mouth.png'><b>");

}
}else{money = "";
moneyText = ""; }
}else{moneyTextRequest = "";
moneyTextRequest = ""; }




QString line = QString("<small>") + myDateTime.toString("yyyy-MM-dd hh:mm");
line += QString(lock) + QString(moneyText) + QString("</small>");
line += QString(lock) + QString(moneyText) + QString(moneyTextRequest) + QString("</small>");
line +=QString("<p>") + _memo.toHtmlEscaped() + QString("</p>");
return line;
}
Expand Down
2 changes: 1 addition & 1 deletion src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ void Controller::refreshTransactions() {
chatModel->addconfirmations(txid, confirmations);
}

if ((confirmations == 1) && (chatModel->getConfirmationByTx(txid) != QString("0xdeadbeef"))) {
if ((confirmations > 0) && (chatModel->getConfirmationByTx(txid) != QString("0xdeadbeef"))) {
DataStore::getChatDataStore()->clear();
chatModel->killConfirmationCache();
chatModel->killMemoCache();
Expand Down
4 changes: 3 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,8 @@ void MainWindow::setupchatTab() {
ui->listChat->addAction(viewexplorer);
ui->listChat->addAction(copytxid);

});

QObject::connect(copymessage, &QAction::triggered, [=] {


Expand Down Expand Up @@ -1478,7 +1480,7 @@ void MainWindow::setupchatTab() {
}
});

});


///////// Add contextmenu
QMenu* contextMenu;
Expand Down

0 comments on commit 515d47d

Please sign in to comment.