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 +V */
27 class ModuleNoInvite : public Module
33 ModuleNoInvite(Server* Me)
37 Srv->AddExtendedMode('V',MT_CHANNEL,false,0,0);
40 void Implements(char* List)
42 List[I_On005Numeric] = List[I_OnUserPreInvite] = List[I_OnExtendedMode] = 1;
45 virtual void On005Numeric(std::string &output)
47 InsertMode(output,"V",4);
51 virtual int OnUserPreInvite(userrec* user,userrec* dest,chanrec* channel)
53 if (channel->IsCustomModeSet('V'))
55 WriteServ(user->fd,"492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
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 == 'V') && (type == MT_CHANNEL))
74 virtual ~ModuleNoInvite()
78 virtual Version GetVersion()
80 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
85 class ModuleNoInviteFactory : public ModuleFactory
88 ModuleNoInviteFactory()
92 ~ModuleNoInviteFactory()
96 virtual Module * CreateModule(Server* Me)
98 return new ModuleNoInvite(Me);
104 extern "C" void * init_module( void )
106 return new ModuleNoInviteFactory;