Stop sending JOIN/PART commands for channels starting with / (#6376)

This commit is contained in:
Mm2PL
2025-08-07 17:32:41 +02:00
committed by GitHub
parent 4ffdc2fa7b
commit f21f1b8781
2 changed files with 14 additions and 3 deletions
+1
View File
@@ -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
+13 -3
View File
@@ -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<std::mutex> 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);
}