1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
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
36 Srv->AddExtendedMode('V',MT_CHANNEL,false,0,0);
39 virtual void On005Numeric(std::string &output)
41 std::stringstream line(output);
42 std::string temp1, temp2;
47 if (temp1.substr(0,10) == "CHANMODES=")
49 // append the chanmode to the end
50 temp1 = temp1.substr(10,temp1.length());
51 temp1 = "CHANMODES=" + temp1 + "V";
53 temp2 = temp2 + temp1 + " ";
56 output = temp2.substr(0,temp2.length()-1);
60 virtual int OnUserPreInvite(userrec* user,userrec* dest,chanrec* channel)
62 if (channel->IsCustomModeSet('V'))
64 WriteServ(user->fd,"492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
70 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
72 // check if this is our mode character...
73 if ((modechar == 'V') && (type == MT_CHANNEL))
83 virtual ~ModuleNoInvite()
88 virtual Version GetVersion()
90 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
95 class ModuleNoInviteFactory : public ModuleFactory
98 ModuleNoInviteFactory()
102 ~ModuleNoInviteFactory()
106 virtual Module * CreateModule()
108 return new ModuleNoInvite;
114 extern "C" void * init_module( void )
116 return new ModuleNoInviteFactory;