From d0b88255f24995c0fb98a508780436a387124b81 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Thu, 30 Apr 2020 00:08:50 +0200 Subject: [PATCH] do not render any header memo on the chatgui - render a incoming contact request - work in progress --- src/chatmodel.cpp | 21 ++++++++++++++++----- src/controller.cpp | 14 +++----------- src/mainwindow.ui | 13 ------------- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 153fe97..9adcd56 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -88,8 +88,21 @@ void ChatModel::renderChatBox(QListWidget *view) { - // if ("" == QString(c.second.getAddress())){ ////// ToDo: render only memos from selected contact - QDateTime myDateTime; + if (c.second.getMemo().startsWith("{\n \"c\": \"true\"")){ + + // Render a incoming contact Request + + } + + if (c.second.getMemo().startsWith("{\n \"c\": \"false\"") ){ + + // we dont want to render this + + } + + if (c.second.getMemo().startsWith("{") == false){ //TOdo and is selected in Contact Widget - + + QDateTime myDateTime; myDateTime.setTime_t(c.second.getTimestamp()); //qDebug() << "[" << myDateTime.toString("dd.MM.yyyy hh:mm:ss ") << "] " << "<" << c.second.getAddress() << "> :" << c.second.getMemo(); @@ -98,10 +111,8 @@ void ChatModel::renderChatBox(QListWidget *view) line += QString(c.second.getMemo()) + QString("\n"); view->addItem(line); line =""; - // } - // else{ + } - // } } } diff --git a/src/controller.cpp b/src/controller.cpp index a28b74c..4a65ba9 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -880,10 +880,7 @@ void Controller::refreshTransactions() if (!o["memo"].is_null()) { memo = QString::fromStdString(o["memo"]); - if (memo.startsWith("{")) - { - }else{ ChatItem item = ChatItem( datetime, address, @@ -892,8 +889,7 @@ void Controller::refreshTransactions() true // is an outgoing message ); chatModel->addMessage(item); - - } + } @@ -934,11 +930,7 @@ void Controller::refreshTransactions() if (!it["memo"].is_null()) { memo = QString::fromStdString(it["memo"]); - if (memo.startsWith("{")) - { - - }else{ - + ChatItem item = ChatItem( datetime, address, @@ -946,7 +938,7 @@ void Controller::refreshTransactions() memo ); chatModel->addMessage(item); - }} + } items.push_back( diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 4c8fa7b..7bb612e 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1374,19 +1374,6 @@ - - - - 350 - 650 - 158 - 25 - - - - Include Reply Address - -