* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
class ModuleAllowInvite : public Module
{
- AllowInvite *ni;
+ AllowInvite ni;
public:
- ModuleAllowInvite(InspIRCd* Me) : Module(Me)
+ ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me)
{
- ni = new AllowInvite(ServerInstance);
- if (!ServerInstance->Modes->AddMode(ni))
+ if (!ServerInstance->Modes->AddMode(&ni))
throw ModuleException("Could not add new modes!");
Implementation eventlist[] = { I_OnUserPreInvite, I_On005Numeric };
ServerInstance->Modules->Attach(eventlist, this, 2);
{
if (IS_LOCAL(user))
{
- if (channel->IsModeSet('A') || channel->IsExtBanned(user, 'A'))
+ if (channel->GetExtBanStatus(user, 'A') == -1)
+ {
+ // Matching extban, explicitly deny /invite
+ user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You are banned from using INVITE", user->nick.c_str(), channel->name.c_str());
+ return 1;
+ }
+ if (channel->IsModeSet('A') || channel->GetExtBanStatus(user, 'A') == 1)
{
// Explicitly allow /invite
return -1;
virtual ~ModuleAllowInvite()
{
- ServerInstance->Modes->DelMode(ni);
- delete ni;
+ ServerInstance->Modes->DelMode(&ni);
}
virtual Version GetVersion()
{
- return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
+ return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
}
};