- Channel* c = (Channel*)dest;
- if (!c->IsModeSet('C'))
- return MOD_RES_PASSTHRU;
-
- if ((text.empty()) || (text[0] != '\001') || (strncmp(text.c_str(),"\1ACTION ",8)))
- return MOD_RES_PASSTHRU;
-
- ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp");
- if (res == MOD_RES_ALLOW)
- return MOD_RES_PASSTHRU;
-
- if (!c->GetExtBanStatus(user, 'C'))
+ case MessageTarget::TYPE_CHANNEL:
+ {
+ if (user->HasPrivPermission("channels/ignore-noctcp"))
+ return MOD_RES_PASSTHRU;
+
+ Channel* c = target.Get<Channel>();
+ 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;
+ }
+ case MessageTarget::TYPE_USER: