7 /* $ModDesc: Provides support for unreal-style channel mode +T */
9 class ModuleNoNotice : public Module
17 Srv->AddExtendedMode('T',MT_CHANNEL,false,0,0);
20 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
22 if (target_type == TYPE_CHANNEL)
24 chanrec* c = (chanrec*)dest;
25 if (c->IsCustomModeSet('T'))
27 if ((Srv->ChanMode(user,c) == "@") || (Srv->ChanMode(user,c) == "%"))
29 // ops and halfops can still /NOTICE the channel
34 WriteServ(user->fd,"404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
42 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
44 // check if this is our mode character...
45 if ((modechar == 'T') && (type == MT_CHANNEL))
55 virtual ~ModuleNoNotice()
60 virtual Version GetVersion()
62 return Version(1,0,0,0);
67 class ModuleNoNoticeFactory : public ModuleFactory
70 ModuleNoNoticeFactory()
74 ~ModuleNoNoticeFactory()
78 virtual Module * CreateModule()
80 return new ModuleNoNotice;
86 extern "C" void * init_module( void )
88 return new ModuleNoNoticeFactory;