Remove JOINs from write connection (#3112)

Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
pajlada 2021-08-03 17:55:04 +02:00 committed by GitHub
parent 95044efeed
commit 28dcdb238b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 37 deletions

View file

@ -4,6 +4,7 @@
- Major: Newly uploaded Twitch emotes are once again present in emote picker and can be autocompleted with Tab as well. (#2992)
- Major: Added the ability to add nicknames for users. (#137, #2981)
- Major: Work on rate-limiting JOINs and PARTs. (#3112)
- Minor: Added autocompletion in /whispers for Twitch emotes, Global Bttv/Ffz emotes and emojis. (#2999, #3033)
- Minor: Received Twitch messages now use the exact same timestamp (obtained from Twitch's server) for every Chatterino user instead of assuming message timestamp on client's side. (#3021)
- Minor: Received IRC messages use `time` message tag for timestamp if it's available. (#3021)

View file

@ -214,11 +214,6 @@ ChannelPtr AbstractIrcServer::getOrAddChannel(const QString &dirtyChannelName)
{
this->readConnection_->sendRaw("PART #" + channelName);
}
if (this->writeConnection_ && this->hasSeparateWriteConnection())
{
this->writeConnection_->sendRaw("PART #" + channelName);
}
}));
// join irc channel
@ -232,14 +227,6 @@ ChannelPtr AbstractIrcServer::getOrAddChannel(const QString &dirtyChannelName)
this->readConnection_->sendRaw("JOIN #" + channelName);
}
}
if (this->writeConnection_ && this->hasSeparateWriteConnection())
{
if (this->readConnection_->isConnected())
{
this->writeConnection_->sendRaw("JOIN #" + channelName);
}
}
}
return chan;

View file

@ -197,34 +197,13 @@ void TwitchIrcServer::writeConnectionMessageReceived(
// Below commands enabled through the twitch.tv/commands CAP REQ
if (command == "USERSTATE")
{
// Received USERSTATE upon PRIVMSGing
// Received USERSTATE upon sending PRIVMSG messages
handler.handleUserStateMessage(message);
}
else if (command == "NOTICE")
{
static std::unordered_set<std::string> readConnectionOnlyIDs{
"host_on",
"host_off",
"host_target_went_offline",
"emote_only_on",
"emote_only_off",
"slow_on",
"slow_off",
"subs_on",
"subs_off",
"r9k_on",
"r9k_off",
// Display for user who times someone out. This implies you're a
// moderator, at which point you will be connected to PubSub and receive
// a better message from there.
"timeout_success",
"ban_success",
// Channel suspended notices
"msg_channel_suspended",
};
// List of expected NOTICE messages on write connection
// https://git.kotmisia.pl/Mm2PL/docs/src/branch/master/irc_msg_ids.md#command-results
handler.handleNoticeMessage(
static_cast<Communi::IrcNoticeMessage *>(message));
}