X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_noctcp.cpp;h=f288820b8b12f3b1e238274a9db550f32b2cfb22;hb=c7dc34b6e08e41136594a86e172423f11ba5bfac;hp=3a57dc184d46ecd46dbf19c9e67cf169ef6ddb50;hpb=d57cad7896a4e9f78565d998e3fbd98b0b32c94e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 3a57dc184..f288820b8 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -61,27 +61,40 @@ class ModuleNoCTCP : public Module if (!details.IsCTCP(ctcpname) || irc::equals(ctcpname, "ACTION")) return MOD_RES_PASSTHRU; - if (target.type == MessageTarget::TYPE_CHANNEL) + switch (target.type) { - Channel* c = target.Get(); - ModResult res = CheckExemption::Call(exemptionprov, user, c, "noctcp"); - if (res == MOD_RES_ALLOW) - return MOD_RES_PASSTHRU; - - if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet(nc))) + case MessageTarget::TYPE_CHANNEL: { - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send CTCP to channel (+C set)"); - return MOD_RES_DENY; + if (user->HasPrivPermission("channels/ignore-noctcp")) + return MOD_RES_PASSTHRU; + + Channel* c = target.Get(); + ModResult res = CheckExemption::Call(exemptionprov, user, c, "noctcp"); + if (res == MOD_RES_ALLOW) + return MOD_RES_PASSTHRU; + + if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet(nc))) + { + user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send CTCP to channel (+C is set)"); + return MOD_RES_DENY; + } + break; } - } - else if (target.type == MessageTarget::TYPE_USER) - { - User* u = target.Get(); - if (u->IsModeSet(ncu)) + case MessageTarget::TYPE_USER: { - user->WriteNumeric(ERR_CANTSENDTOUSER, u->nick, "Can't send CTCP to user (+T set)"); - return MOD_RES_DENY; + if (user->HasPrivPermission("users/ignore-noctcp")) + return MOD_RES_PASSTHRU; + + User* u = target.Get(); + if (u->IsModeSet(ncu)) + { + user->WriteNumeric(ERR_CANTSENDTOUSER, u->nick, "Can't send CTCP to user (+T is set)"); + return MOD_RES_DENY; + } + break; } + case MessageTarget::TYPE_SERVER: + break; } return MOD_RES_PASSTHRU; }