1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Provides support for unreal-style channel mode +V */
18 class NoInvite : public SimpleChannelModeHandler
21 NoInvite(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'V') { }
24 class ModuleNoInvite : public Module
29 ModuleNoInvite(InspIRCd* Me) : Module(Me)
31 ni = new NoInvite(ServerInstance);
32 if (!ServerInstance->Modes->AddMode(ni))
33 throw ModuleException("Could not add new modes!");
34 Implementation eventlist[] = { I_OnUserPreInvite, I_On005Numeric };
35 ServerInstance->Modules->Attach(eventlist, this, 2);
38 virtual void On005Numeric(std::string &output)
40 ServerInstance->AddExtBanChar('V');
43 virtual int OnUserPreInvite(User* user,User* dest,Channel* channel, time_t timeout)
47 if (CHANOPS_EXEMPT(ServerInstance, 'c') && channel->GetStatus(user) == STATUS_OP)
52 if (channel->IsModeSet('V') || channel->IsExtBanned(user, 'V'))
54 user->WriteNumeric(ERR_NOCTCPALLOWED, "%s %s :Can't invite %s to channel (+V set)",user->nick.c_str(), channel->name.c_str(), dest->nick.c_str());
62 virtual ~ModuleNoInvite()
64 ServerInstance->Modes->DelMode(ni);
68 virtual Version GetVersion()
70 return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
74 MODULE_INIT(ModuleNoInvite)