Skip to content

Commit

Permalink
Remove JOINs from write connection (#3112)
Browse files Browse the repository at this point in the history
Co-authored-by: zneix <zneix@zneix.eu>
  • Loading branch information
pajlada and zneix committed Aug 3, 2021
1 parent 95044ef commit 28dcdb2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions src/providers/irc/AbstractIrcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
27 changes: 3 additions & 24 deletions src/providers/twitch/TwitchIrcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 28dcdb2

Please sign in to comment.