split InviteDialog into ShareInviteDialog + InviteByLinkDialog, add INV button to channel list

This commit is contained in:
evgeny committed 2026-08-04 22:42:22 +03:00
1 parent 5632bc9c8b
commit 24316e8cf8
9 files changed
+259 -248

No files matched your search

+14 -3
View File
@@ -3,6 +3,7 @@
#include "messagelist.h"
#include "accountlist.h"
#include "invitedialog.h"
#include "inviteby.h"
#include "joindialog.h"
#include "settingsdialog.h"
#include "creategroupdialog.h"
@@ -281,7 +282,8 @@ void MainWindow::setupConnects() {
char* cid = u_strdup(cidBA.constData());
if (cid) gui_bridge_post_uasync_fn(chat_core_connect_channel_trampoline, cid);
});
connect(m_channelList, &ChannelList::inviteRequested, this, &MainWindow::showInviteDialog);
connect(m_channelList, &ChannelList::inviteRequested, this, &MainWindow::showShareInviteDialog);
connect(m_channelList, &ChannelList::inviteByLinkRequested, this, &MainWindow::showInviteByLinkDialog);
connect(m_channelList, &ChannelList::joinRequested, this, &MainWindow::showJoinDialog);
connect(m_channelList, &ChannelList::createGroupRequested, this, &MainWindow::onCreateGroupRequested);
connect(m_channelList, &ChannelList::settingsRequested, this, &MainWindow::showSettings);
@@ -344,7 +346,7 @@ void MainWindow::onTrayActivated(QSystemTrayIcon::ActivationReason reason) {
}
}
void MainWindow::showInviteDialog(const QString& channelId) {
void MainWindow::showShareInviteDialog(const QString& channelId) {
if (!m_db || !m_db->isOpen()) return;
QByteArray pubkey;
@@ -364,7 +366,16 @@ void MainWindow::showInviteDialog(const QString& channelId) {
return;
}
InviteDialog dlg(link, channelId, m_node, this);
ShareInviteDialog dlg(link, this);
dlg.exec();
}
void MainWindow::showInviteByLinkDialog(const QString& channelId) {
if (!m_node || !m_node->isRunning()) {
QMessageBox::warning(this, "Error", "Node is not running.");
return;
}
InviteByLinkDialog dlg(channelId, m_node, this);
dlg.exec();
}