Filter desktop invitation targets by local membership

This commit is contained in:
evgeny committed 2026-10-04 14:59:08 +02:00
1 parent 55d9e79983
commit ef62a80eb8
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
}