From f21f1b87818b7a95064e843be16e18ecafb7864c Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 7 Aug 2025 17:32:41 +0200 Subject: [PATCH] Stop sending `JOIN`/`PART` commands for channels starting with `/` (#6376) --- CHANGELOG.md | 1 + src/providers/twitch/TwitchIrcServer.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fab52e91..622bddbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,7 @@ - Dev: Added some commands for forcing a relayout (and related things) in channel views. (#6342) - Dev: Update vcpkg baseline. (#6359) - Dev: Added an explicit `frozen` flag to `Message`. (#6367) +- Dev: Stop sending `JOIN`/`PART` commands for channels starting with `/`. (#6376) ## 2.5.3 diff --git a/src/providers/twitch/TwitchIrcServer.cpp b/src/providers/twitch/TwitchIrcServer.cpp index 3458cb60..3cde0663 100644 --- a/src/providers/twitch/TwitchIrcServer.cpp +++ b/src/providers/twitch/TwitchIrcServer.cpp @@ -463,6 +463,11 @@ void TwitchIrcServer::onReadConnected(IrcConnection *connection) // join channels for (const auto &channel : activeChannels) { + // HACK(mm2pl): This prevents custom invalid twitch channels used by plugins from being joined + if (channel->getName().startsWith("/")) + { + continue; + } this->joinBucket_->send(channel->getName()); } @@ -1166,7 +1171,11 @@ ChannelPtr TwitchIrcServer::getOrAddChannel(const QString &dirtyChannelName) if (this->readConnection_) { - this->readConnection_->sendRaw("PART #" + channelName); + // HACK(mm2pl): This prevents custom invalid twitch channels used by plugins from being joined + if (!channelName.startsWith("/")) + { + this->readConnection_->sendRaw("PART #" + channelName); + } } }); @@ -1174,9 +1183,10 @@ ChannelPtr TwitchIrcServer::getOrAddChannel(const QString &dirtyChannelName) { std::lock_guard lock2(this->connectionMutex_); - if (this->readConnection_) + if (this->readConnection_ && this->readConnection_->isConnected()) { - if (this->readConnection_->isConnected()) + // HACK(mm2pl): This prevents custom invalid twitch channels used by plugins from being joined + if (!channelName.startsWith("/")) { this->joinBucket_->send(channelName); }