show oldrequest information
This commit is contained in:
@@ -83,11 +83,8 @@ void MainWindow::renderContactRequest(){
|
|||||||
|
|
||||||
QStandardItemModel* contactRequest = new QStandardItemModel();
|
QStandardItemModel* contactRequest = new QStandardItemModel();
|
||||||
|
|
||||||
// auto labels = AddressBook::getInstance()->getAllAddressLabels();
|
|
||||||
for (auto &c : DataStore::getChatDataStore()->getAllNewContactRequests())
|
for (auto &c : DataStore::getChatDataStore()->getAllNewContactRequests())
|
||||||
|
|
||||||
|
|
||||||
// if (labels.adress() != c.second.getRequestZaddr())
|
|
||||||
{
|
{
|
||||||
|
|
||||||
QStandardItem* Items = new QStandardItem(c.second.getAddress());
|
QStandardItem* Items = new QStandardItem(c.second.getAddress());
|
||||||
@@ -95,17 +92,20 @@ void MainWindow::renderContactRequest(){
|
|||||||
requestContact.requestContact->setModel(contactRequest);
|
requestContact.requestContact->setModel(contactRequest);
|
||||||
requestContact.requestContact->show();
|
requestContact.requestContact->show();
|
||||||
}
|
}
|
||||||
QStandardItemModel* contactRequestOld = new QStandardItemModel();
|
|
||||||
|
|
||||||
|
QStandardItemModel* contactRequestOld = new QStandardItemModel();
|
||||||
|
for (auto &p : AddressBook::getInstance()->getAllAddressLabels())
|
||||||
for (auto &c : DataStore::getChatDataStore()->getAllOldContactRequests())
|
for (auto &c : DataStore::getChatDataStore()->getAllOldContactRequests())
|
||||||
{
|
{
|
||||||
|
if (p.getPartnerAddress() == c.second.getRequestZaddr())
|
||||||
|
{
|
||||||
QStandardItem* Items = new QStandardItem(c.second.getAddress());
|
QStandardItem* Items = new QStandardItem(c.second.getAddress());
|
||||||
contactRequestOld->appendRow(Items);
|
contactRequestOld->appendRow(Items);
|
||||||
requestContact.requestContactOld->setModel(contactRequestOld);
|
requestContact.requestContactOld->setModel(contactRequestOld);
|
||||||
requestContact.requestContactOld->show();
|
requestContact.requestContactOld->show();
|
||||||
|
}else{}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
QObject::connect(requestContact.requestContact, &QTableView::clicked, [&] () {
|
QObject::connect(requestContact.requestContact, &QTableView::clicked, [&] () {
|
||||||
|
|
||||||
@@ -132,6 +132,33 @@ void MainWindow::renderContactRequest(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(requestContact.requestContactOld, &QTableView::clicked, [&] () {
|
||||||
|
|
||||||
|
for (auto &c : DataStore::getChatDataStore()->getAllRawChatItems()){
|
||||||
|
QModelIndex index = requestContact.requestContactOld->currentIndex();
|
||||||
|
QString label_contactold = index.data(Qt::DisplayRole).toString();
|
||||||
|
QStandardItemModel* contactMemo = new QStandardItemModel();
|
||||||
|
|
||||||
|
if ((c.second.isOutgoing() == false) && (label_contactold == c.second.getAddress()) && (c.second.getType() != "Cont"))
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
QStandardItem* Items = new QStandardItem(c.second.getMemo());
|
||||||
|
contactMemo->appendRow(Items);
|
||||||
|
requestContact.requestMemo->setModel(contactMemo);
|
||||||
|
requestContact.requestMemo->show();
|
||||||
|
|
||||||
|
|
||||||
|
requestContact.requestZaddr->setText(c.second.getRequestZaddr());
|
||||||
|
requestContact.requestCID->setText(c.second.getCid());
|
||||||
|
requestContact.requestMyAddr->setText(c.second.getAddress());
|
||||||
|
}else{}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(requestContact.pushButton, &QPushButton::clicked, [&] () {
|
QObject::connect(requestContact.pushButton, &QPushButton::clicked, [&] () {
|
||||||
@@ -174,6 +201,11 @@ void MainWindow::renderContactRequest(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
|
|
||||||
|
rpc->refreshContacts(
|
||||||
|
ui->listContactWidget
|
||||||
|
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatModel::addCid(QString tx, QString cid)
|
void ChatModel::addCid(QString tx, QString cid)
|
||||||
|
|||||||
Reference in New Issue
Block a user