diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 5f4a601..f84b8de 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -596,7 +596,7 @@ void MainWindow::sendChat() { ui->memoTxtChat->clear(); // And send the Tx - rpc->executeTransaction(tx, + rpc->executeTransaction(tx, true, [=] (QString txid) { ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); @@ -887,7 +887,7 @@ void MainWindow::ContactRequest() { ui->memoTxtChat->clear(); // And send the Tx - rpc->executeTransaction(tx, + rpc->executeTransaction(tx, true, [=] (QString txid) { ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); diff --git a/src/controller.cpp b/src/controller.cpp index 89fc73f..f419485 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -132,7 +132,7 @@ void Controller::setConnection(Connection* c) } // Build the RPC JSON Parameters for this tx -void Controller::fillTxJsonParams(json& allRecepients, Tx tx) +void Controller::fillTxJsonParams(json& allRecepients, Tx tx, bool isChatMessage) { Q_ASSERT(allRecepients.is_array()); @@ -194,7 +194,8 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx) if (spendableNotesCount < 30 && balanceAvailable.toDecimalString().toDouble() > (dustTransactions.size() * 0.0001) && - isNoteAutomationEnabled) { + isNoteAutomationEnabled && + isChatMessage) { // Create extra transaction for (size_t i = 0; i < dustTransactions.size(); ++i) { // Generate random memo @@ -1506,7 +1507,7 @@ void Controller::unlockIfEncrypted(std::function cb, std::functionstatusBar->showMessage(Settings::txidStatusMessage + " " + txid); }, [=] (QString opid, QString errStr) { @@ -1528,7 +1529,7 @@ void Controller::executeStandardUITransaction(Tx tx) } // Execute a transaction! -void Controller::executeTransaction(Tx tx, +void Controller::executeTransaction(Tx tx, bool isChatMessage, const std::function submitted, const std::function error) { @@ -1538,7 +1539,7 @@ void Controller::executeTransaction(Tx tx, unlockIfEncrypted([=] () { // First, create the json params json params = json::array(); - fillTxJsonParams(params, tx); + fillTxJsonParams(params, tx, isChatMessage); std::cout << std::setw(2) << params << std::endl; zrpc->sendTransaction(QString::fromStdString(params.dump()), [=](const json& reply) { diff --git a/src/controller.h b/src/controller.h index debc699..d9b98f2 100644 --- a/src/controller.h +++ b/src/controller.h @@ -86,11 +86,11 @@ public: void executeStandardUITransaction(Tx tx); - void executeTransaction(Tx tx, + void executeTransaction(Tx tx, bool isChatMessage, const std::function submitted, const std::function error); - void fillTxJsonParams(json& params, Tx tx); + void fillTxJsonParams(json& params, Tx tx, bool isChatMessage); const TxTableModel* getTransactionsModel() { return transactionsTableModel; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 231dad7..38813bb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2032,7 +2032,7 @@ void MainWindow::sendMoneyChat() { ui->memoTxtChat->clear(); // And send the Tx - rpc->executeTransaction(tx, + rpc->executeTransaction(tx, true, [=] (QString txid) { ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); @@ -2320,7 +2320,7 @@ void MainWindow::sendMoneyRequestChat() { ui->memoTxtChat->clear(); // And send the Tx - rpc->executeTransaction(tx, + rpc->executeTransaction(tx, true, [=] (QString txid) { ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); diff --git a/src/recurring.cpp b/src/recurring.cpp index 88dcfe7..1089499 100644 --- a/src/recurring.cpp +++ b/src/recurring.cpp @@ -600,7 +600,7 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r * Execute a send Tx */ void Recurring::doSendTx(MainWindow* mainwindow, Tx tx, std::function cb) { - mainwindow->getRPC()->executeTransaction(tx, + mainwindow->getRPC()->executeTransaction(tx, false, [=] (QString txid) { mainwindow->ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); cb(txid, ""); diff --git a/src/sendtab.cpp b/src/sendtab.cpp index d32a987..2bd4fab 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -864,7 +864,7 @@ void MainWindow::sendButton() { d->show(); // And send the Tx - rpc->executeTransaction(tx, + rpc->executeTransaction(tx, false, [=] (QString txid) { ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid);