From ef62a80eb81d231bb38522abf6ff0568643aa75c Mon Sep 17 00:00:00 2001 From: evgeny Date: Sun, 4 Oct 2026 14:59:08 +0200 Subject: [PATCH] Filter desktop invitation targets by local membership --- tools/chatgui/src/dminvitedialog.cpp | 4 +++- tools/chatgui/src/mainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/chatgui/src/dminvitedialog.cpp b/tools/chatgui/src/dminvitedialog.cpp index 2697eb6f..7cb75a6d 100644 --- a/tools/chatgui/src/dminvitedialog.cpp +++ b/tools/chatgui/src/dminvitedialog.cpp @@ -23,7 +23,9 @@ DmInviteDialog::DmInviteDialog(DbManager* db, quint64 peer, const QString& name, auto* layout = new QVBoxLayout(this); layout->addWidget(new QLabel(QStringLiteral("Получатель: %1").arg(name), this)); m_groups = new QComboBox(this); - for (const auto& group : db->getChannels()) m_groups->addItem(group.name, group.channelId); + for (const auto& group : db->getChannels()) { + if (db->isChannelMember(group.channelId, db->myNodeId())) m_groups->addItem(group.name, group.channelId); + } m_groups->setCurrentIndex(-1); m_groups->setPlaceholderText(QStringLiteral("Выберите группу")); layout->addWidget(m_groups); diff --git a/tools/chatgui/src/mainwindow.cpp b/tools/chatgui/src/mainwindow.cpp index 595dcb88..ff364d17 100644 --- a/tools/chatgui/src/mainwindow.cpp +++ b/tools/chatgui/src/mainwindow.cpp @@ -706,7 +706,7 @@ void MainWindow::onInviteLinkActivated(const QString& link) { } const QString channelId = QString::number(invite.channelId); for (const auto& channel : m_db->getChannels()) { - if (channel.channelId == channelId && topo_node_sqlite_member_in_channel(m_db->db(), channelId.toUtf8().constData(), m_db->myNodeId())) { + if (channel.channelId == channelId && m_db->isChannelMember(channelId, m_db->myNodeId())) { GUI_INFO("invite link: opening existing group ch=%s", qPrintable(channelId)); m_channelList->selectChannel(channelId); return; }