From 44e75e661e2cc38cc350807acf943f6107c0c86a Mon Sep 17 00:00:00 2001 From: evgeny Date: Sun, 4 Oct 2026 14:54:58 +0200 Subject: [PATCH] Forward member invitation actions to main window --- tools/chatgui/src/accountlist.cpp | 8 +++++++- tools/chatgui/src/accountlist.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/chatgui/src/accountlist.cpp b/tools/chatgui/src/accountlist.cpp index 76e2b805..7138d98b 100644 --- a/tools/chatgui/src/accountlist.cpp +++ b/tools/chatgui/src/accountlist.cpp @@ -81,7 +81,13 @@ AccountList::AccountList(DbManager* db, QWidget *parent) layout->addWidget(m_header); m_listView->setModel(m_model); - m_listView->setItemDelegate(new AccountDelegate(m_listView)); + auto* delegate = new AccountDelegate(m_listView); + m_listView->setItemDelegate(delegate); + connect(delegate, &AccountDelegate::inviteRequested, this, [this](const QModelIndex& index) { + const quint64 peer = m_model->nodeIdAt(index.row()); + if (peer && m_db && peer != m_db->myNodeId()) + emit inviteRequested(m_channelId, peer, index.data(Qt::DisplayRole).toString()); + }); m_listView->setEditTriggers(QAbstractItemView::NoEditTriggers); m_listView->setSelectionMode(QAbstractItemView::SingleSelection); m_listView->setMouseTracking(true); diff --git a/tools/chatgui/src/accountlist.h b/tools/chatgui/src/accountlist.h index 268c3ebd..7c1d7280 100644 --- a/tools/chatgui/src/accountlist.h +++ b/tools/chatgui/src/accountlist.h @@ -71,6 +71,7 @@ signals: void memberRenamed(); void callRequested(const QString& channelId, quint64 nodeId, const QString& name); void pmRequested(const QString& channelId, quint64 nodeId, const QString& name); + void inviteRequested(const QString& channelId, quint64 nodeId, const QString& name); private slots: void onMemberClicked(const QModelIndex& index);