1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
22 /* $ModDesc: Provides support for unreal-style channel mode +T */
24 class ModuleNoNotice : public Module
32 Srv->AddExtendedMode('T',MT_CHANNEL,false,0,0);
35 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
37 if (target_type == TYPE_CHANNEL)
39 chanrec* c = (chanrec*)dest;
40 if (c->IsCustomModeSet('T'))
42 if ((Srv->ChanMode(user,c) == "@") || (Srv->ChanMode(user,c) == "%"))
44 // ops and halfops can still /NOTICE the channel
49 WriteServ(user->fd,"404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
57 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
59 // check if this is our mode character...
60 if ((modechar == 'T') && (type == MT_CHANNEL))
70 virtual ~ModuleNoNotice()
75 virtual Version GetVersion()
77 return Version(1,0,0,0);
82 class ModuleNoNoticeFactory : public ModuleFactory
85 ModuleNoNoticeFactory()
89 ~ModuleNoNoticeFactory()
93 virtual Module * CreateModule()
95 return new ModuleNoNotice;
101 extern "C" void * init_module( void )
103 return new ModuleNoNoticeFactory;