7 /* $ModDesc: Provides support for unreal-style channel mode +c */
9 class ModuleNoCTCP : public Module
18 Srv->AddExtendedMode('C',MT_CHANNEL,false,0,0);
21 virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
23 if (target_type == TYPE_CHANNEL)
25 chanrec* c = (chanrec*)dest;
26 if (c->IsCustomModeSet('C'))
28 if ((text.length()) && (text[0] == '\1'))
30 if (strncmp(text.c_str(),"\1ACTION ",8))
32 WriteServ(user->fd,"492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name);
41 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
43 if (target_type == TYPE_CHANNEL)
45 chanrec* c = (chanrec*)dest;
46 if (c->IsCustomModeSet('C'))
48 if ((text.length()) && (text[0] == '\1'))
50 if (strncmp(text.c_str(),"\1ACTION ",8))
52 WriteServ(user->fd,"492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name);
61 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
63 // check if this is our mode character...
64 if ((modechar == 'C') && (type == MT_CHANNEL))
74 virtual ~ModuleNoCTCP()
79 virtual Version GetVersion()
81 return Version(1,0,0,0);
86 class ModuleNoCTCPFactory : public ModuleFactory
93 ~ModuleNoCTCPFactory()
97 virtual Module * CreateModule()
99 return new ModuleNoCTCP;
105 extern "C" void * init_module( void )
107 return new ModuleNoCTCPFactory;