first implementation of automated contact request detection - work in progress

This commit is contained in:
DenioD
2020-05-06 15:41:40 +02:00
parent 6a3b644a0a
commit 5ff2d1ba47
14 changed files with 599 additions and 115 deletions

View File

@@ -1,3 +1,5 @@
// Copyright 2019-2020 The Hush developers
// GPLv3
#include "mainwindow.h"
#include "addressbook.h"
#include "viewalladdresses.h"
@@ -15,6 +17,8 @@
#include "version.h"
#include "connection.h"
#include "ui_contactrequest.h"
#include "ui_requestContactDialog.h"
#include "chatmodel.h"
#include "requestdialog.h"
#include "websockets.h"
#include <QRegularExpression>
@@ -1006,22 +1010,21 @@ void MainWindow::setupchatTab() {
// Is request Contact checked?
if (ui->request->isChecked()) {
// if (ui->request->isChecked()) {
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::ContactRequest);
// qDebug() <<ui->request->isChecked()->text();
}else{
// }else{
QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
// QObject::connect(ui->sendChatButton, &QPushButton::clicked, this, &MainWindow::sendChatButton);
}
// }
QObject::connect(ui->safeContactRequest, &QPushButton::clicked, this, &MainWindow::addContact);
///////// Set selected Zaddr for Chat with Doubleklick
///////// Set selected Zaddr for Chat with Klick
QObject::connect(ui->listContactWidget, &QTableView::clicked, [=] () {
@@ -1046,6 +1049,19 @@ void MainWindow::setupchatTab() {
}
/*
void MainWindow::setChatItem(ChatItem * item)
{
this->currentChatItem = item;
}
ChatItem* MainWindow::getChatItem()
{
return this->currentChatItem;
}*/
ChatMemoEdit::ChatMemoEdit(QWidget* parent) : QPlainTextEdit(parent) {
QObject::connect(this, &QPlainTextEdit::textChanged, this, &ChatMemoEdit::updateDisplay);
}