e454c12bd7f695d6450dc804c07aa5637a8b1c00 — Florent Le Coz 9 years ago a2b0f21
Do not forward CTCP commands (PING, VERSION…) to the user as private messages

Some XMPP client ping themselves inside MUCs, to know if they are still in
there, this created a flood of PING message in private.  If the user is
interested in knowing when they receive a ping or version request, they can
still read their XML logs
1 files changed, 4 insertions(+), 0 deletions(-)

M src/irc/irc_client.cpp
M src/irc/irc_client.cpp => src/irc/irc_client.cpp +4 -0
@@ 314,6 314,10 @@ void IrcClient::on_notice(const IrcMessage& message)
  const std::string to = message.arguments[0];
  const std::string body = message.arguments[1];

  if (!body.empty() && body[0] == '\01' && body[body.size() - 1] == '\01')
    // Do not forward the notice to the user if it's a CTCP command
    return ;

  if (!to.empty() && this->chantypes.find(to[0]) == this->chantypes.end())
      // The notice is for us precisely.