#include "inspircd.h"
-/* $ModDesc: Provides channel mode +C to block CTCPs */
-
class NoCTCP : public SimpleChannelModeHandler
{
public:
void init() CXX11_OVERRIDE
{
ServerInstance->Modules->AddService(nc);
- Implementation eventlist[] = { I_OnUserPreMessage, I_On005Numeric };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
Version GetVersion() CXX11_OVERRIDE
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
- if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet('C')))
+ if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet(nc)))
{
user->WriteNumeric(ERR_NOCTCPALLOWED, "%s %s :Can't send CTCP to channel (+C set)",user->nick.c_str(), c->name.c_str());
return MOD_RES_DENY;