Add local channel deletion to desktop channel settings
This commit is contained in:
1 parent
d67e0b0c23
commit
962a2df3f8
12 files changed
+203
-8
No files matched your search
@@ -1355,6 +1355,23 @@ void MainWindow::onChannelPeersOnline(const char* ch_id, int ch_id_len, uint16_t
|
||||
}
|
||||
|
||||
void MainWindow::reloadChannels() {
|
||||
if (m_db && m_db->isOpen() && !m_currentChannelId.isEmpty() && !m_currentChannelId.startsWith(QStringLiteral("dm:"))) {
|
||||
bool exists = false;
|
||||
for (const auto& channel : m_db->getChannels()) if (channel.channelId == m_currentChannelId) { exists = true; break; }
|
||||
if (!exists) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CHAT, "channel removed from GUI: channel=%s", qPrintable(m_currentChannelId));
|
||||
for (int i = m_autoPlayQueue.size() - 1; i >= 0; --i) if (m_autoPlayQueue[i].channelId == m_currentChannelId) {
|
||||
m_autoPlayDownloading.remove(m_autoPlayQueue[i].msgId);
|
||||
m_autoPlayQueue.removeAt(i);
|
||||
}
|
||||
if (m_pendingChannelSelect == m_currentChannelId) m_pendingChannelSelect.clear();
|
||||
m_messageList->loadChannel(QString());
|
||||
m_accountList->setChannel(QString());
|
||||
m_currentChannelId.clear();
|
||||
saveLastChannelId(QString());
|
||||
if (m_messageNotification) m_messageNotification->dismiss("channel deleted");
|
||||
}
|
||||
}
|
||||
if (m_channelList) {
|
||||
m_channelList->loadChannels();
|
||||
if (!m_pendingChannelSelect.isEmpty()) {
|
||||
|
||||
Reference in new issue
Block a user