Browse Source

do not render any header memo on the chatgui - render a incoming contact request - work in progress

pull/130/head
DenioD 4 years ago
parent
commit
d0b88255f2
  1. 21
      src/chatmodel.cpp
  2. 14
      src/controller.cpp
  3. 13
      src/mainwindow.ui

21
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{
}
// }
}
}

14
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(

13
src/mainwindow.ui

@ -1374,19 +1374,6 @@
</rect>
</property>
</widget>
<widget class="QPushButton" name="btnInsertFrom">
<property name="geometry">
<rect>
<x>350</x>
<y>650</y>
<width>158</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>Include Reply Address</string>
</property>
</widget>
<widget class="QLabel" name="memoSizeChat">
<property name="geometry">
<rect>

Loading…
Cancel
Save