~singpolyma/biboumi

3af9d0ac67377c5b7535415696d73bd470aa08f7 — louiz’ 5 years ago f588ce0
Make sure we don’t exceed 512 bytes when grouping JOINs
1 files changed, 11 insertions(+), 0 deletions(-)

M src/irc/irc_client.cpp
M src/irc/irc_client.cpp => src/irc/irc_client.cpp +11 -0
@@ 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;