1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 * ---------------------------------------------------
23 #include "helperfuncs.h"
25 /* $ModDesc: Provides support for unreal-style channel mode +T */
27 class ModuleNoNotice : public Module
32 ModuleNoNotice(Server* Me)
36 Srv->AddExtendedMode('T',MT_CHANNEL,false,0,0);
39 void Implements(char* List)
41 List[I_OnUserPreNotice] = List[I_On005Numeric] = List[I_OnExtendedMode] = 1;
44 virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
46 if (target_type == TYPE_CHANNEL)
48 chanrec* c = (chanrec*)dest;
49 if (c->IsCustomModeSet('T'))
51 if ((Srv->IsUlined(user->server)) || (Srv->ChanMode(user,c) == "@") || (Srv->ChanMode(user,c) == "%"))
53 // ops and halfops can still /NOTICE the channel
58 WriteServ(user->fd,"404 %s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
66 virtual void On005Numeric(std::string &output)
68 InsertMode(output,"T",4);
71 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
73 // check if this is our mode character...
74 if ((modechar == 'T') && (type == MT_CHANNEL))
84 virtual ~ModuleNoNotice()
88 virtual Version GetVersion()
90 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
95 class ModuleNoNoticeFactory : public ModuleFactory
98 ModuleNoNoticeFactory()
102 ~ModuleNoNoticeFactory()
106 virtual Module * CreateModule(Server* Me)
108 return new ModuleNoNotice(Me);
114 extern "C" void * init_module( void )
116 return new ModuleNoNoticeFactory;