From 515d47df9d8958ed964b377a3a513cfe9d3613f1 Mon Sep 17 00:00:00 2001
From: DenioD <41270280+DenioD@users.noreply.github.com>
Date: Sun, 21 Jun 2020 08:49:45 +0200
Subject: [PATCH] show chatitems only one time #142
---
src/Model/ChatItem.cpp | 15 ++++++++-------
src/controller.cpp | 2 +-
src/mainwindow.cpp | 4 +++-
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/Model/ChatItem.cpp b/src/Model/ChatItem.cpp
index 34d1992..349be68 100644
--- a/src/Model/ChatItem.cpp
+++ b/src/Model/ChatItem.cpp
@@ -160,6 +160,7 @@ QString ChatItem::toChatLine()
QString lock;
QString money;
QString moneyText;
+ QString moneyTextRequest;
myDateTime.setTime_t(_timestamp);
if (_notarize == true)
@@ -177,7 +178,7 @@ QString ChatItem::toChatLine()
{
lock = "
";
- }
+ }else{}
if (_memo.startsWith("Money transaction of :"))
{
@@ -192,28 +193,28 @@ QString ChatItem::toChatLine()
}
}else{money = "";
- moneyText = ""; }
+ moneyText = ""; }
if (_memo.startsWith("Request of :"))
{
if (_outgoing == true)
{
- moneyText = QString("
Outgoing Hush Request
") + QString("Outgoing Hush Request
") + QString("Incoming Hush Request
") + QString("Incoming Hush Request
") + QString("") + _memo.toHtmlEscaped() + QString("
"); return line; } diff --git a/src/controller.cpp b/src/controller.cpp index 2fe7221..b777da2 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -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(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d5e979d..397baf1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1386,6 +1386,8 @@ void MainWindow::setupchatTab() { ui->listChat->addAction(viewexplorer); ui->listChat->addAction(copytxid); + }); + QObject::connect(copymessage, &QAction::triggered, [=] { @@ -1478,7 +1480,7 @@ void MainWindow::setupchatTab() { } }); -}); + ///////// Add contextmenu QMenu* contextMenu;