summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-21 22:55:24 +0200
committerlouiz’ <louiz@louiz.org>2017-04-21 22:55:24 +0200
commit3af9d0ac67377c5b7535415696d73bd470aa08f7 (patch)
treec24f9b88f3bb833d2b13183214025b2fd21e482a /src/irc/irc_client.cpp
parentf588ce071eb99ce80fd25f899679e902214606cd (diff)
downloadbiboumi-3af9d0ac67377c5b7535415696d73bd470aa08f7.tar.gz
biboumi-3af9d0ac67377c5b7535415696d73bd470aa08f7.tar.bz2
biboumi-3af9d0ac67377c5b7535415696d73bd470aa08f7.tar.xz
biboumi-3af9d0ac67377c5b7535415696d73bd470aa08f7.zip
Make sure we don’t exceed 512 bytes when grouping JOINs
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index ea5afd2..90fad75 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -858,6 +858,12 @@ void IrcClient::on_welcome_message(const IrcMessage& message)
continue;
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())
keys += ",";
keys += key;
@@ -867,6 +873,11 @@ void IrcClient::on_welcome_message(const IrcMessage& message)
}
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())
channels += ",";
channels += chan;