Commit 3af9d0ac authored by louiz’'s avatar louiz’

Make sure we don’t exceed 512 bytes when grouping JOINs

parent f588ce07
...@@ -858,6 +858,12 @@ void IrcClient::on_welcome_message(const IrcMessage& message) ...@@ -858,6 +858,12 @@ void IrcClient::on_welcome_message(const IrcMessage& message)
continue; continue;
if (!key.empty()) if (!key.empty())
{ {
if (keys.size() + channels_with_key.size() >= 300)
{ // Arbitrary size, to make sure we never send more than 512
this->send_join_command(channels_with_key, keys);
channels_with_key.clear();
keys.clear();
}
if (!keys.empty()) if (!keys.empty())
keys += ","; keys += ",";
keys += key; keys += key;
...@@ -867,6 +873,11 @@ void IrcClient::on_welcome_message(const IrcMessage& message) ...@@ -867,6 +873,11 @@ void IrcClient::on_welcome_message(const IrcMessage& message)
} }
else else
{ {
if (channels.size() >= 300)
{ // Arbitrary size, to make sure we never send more than 512
this->send_join_command(channels, {});
channels.clear();
}
if (!channels.empty()) if (!channels.empty())
channels += ","; channels += ",";
channels += chan; channels += chan;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment