7 /* $ModDesc: Provides support for unreal-style channel mode +c */
9 class ModuleBlockColor : 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;
27 snprintf(ctext,MAXBUF,"%s",text.c_str());
28 if (c->IsCustomModeSet('c'))
30 if (strchr(ctext,'\2')) || (strchr(ctext,'\3')) || (strchr(ctext,31))
32 WriteServ(user->fd,"404 %s %s :Can't send colors to channel (+c set)",user->nick, c->name);
40 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
42 if (target_type == TYPE_CHANNEL)
44 chanrec* c = (chanrec*)dest;
46 snprintf(ctext,MAXBUF,"%s",text.c_str());
47 if (c->IsCustomModeSet('c'))
49 if (strchr(ctext,'\2')) || (strchr(ctext,'\3')) || (strchr(ctext,31))
51 WriteServ(user->fd,"404 %s %s :Can't send colors to channel (+c set)",user->nick, c->name);
59 virtual ~ModuleBlockColor()
64 virtual Version GetVersion()
66 return Version(1,0,0,0);
71 class ModuleBlockColorFactory : public ModuleFactory
74 ModuleBlockColorFactory()
78 ~ModuleBlockColorFactory()
82 virtual Module * CreateModule()
84 return new ModuleBlockColor;
90 extern "C" void * init_module( void )
92 return new ModuleBlockColorFactory;