Commit e454c12b authored by louiz’'s avatar louiz’

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
parent a2b0f21a
......@@ -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.
......
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