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
This commit is contained in:
@@ -314,6 +314,10 @@ void IrcClient::on_notice(const IrcMessage& message)
|
|||||||
const std::string to = message.arguments[0];
|
const std::string to = message.arguments[0];
|
||||||
const std::string body = message.arguments[1];
|
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())
|
if (!to.empty() && this->chantypes.find(to[0]) == this->chantypes.end())
|
||||||
{
|
{
|
||||||
// The notice is for us precisely.
|
// The notice is for us precisely.
|
||||||
|
|||||||
Reference in New Issue
Block a user