-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
*
- * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- * E-mail:
- * <brain@chatspike.net>
- * <Craig@chatspike.net>
- *
- * Written by Craig Edwards, Craig McLure, and others.
* This program is free but copyrighted software; see
- * the file COPYING for details.
+ * the file COPYING for details.
*
* ---------------------------------------------------
*/
-using namespace std;
-
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "inspircd.h"
/* $ModDesc: Provides support for unreal-style channel mode +V */
NoInvite *ni;
public:
- ModuleNoInvite(InspIRCd* Me) : Module::Module(Me)
+ ModuleNoInvite(InspIRCd* Me) : Module(Me)
{
ni = new NoInvite(ServerInstance);
- ServerInstance->AddMode(ni, 'V');
+ if (!ServerInstance->AddMode(ni, 'V'))
+ throw ModuleException("Could not add new modes!");
}
void Implements(char* List)
virtual ~ModuleNoInvite()
{
+ ServerInstance->Modes->DelMode(ni);
DELETE(ni);
}
virtual Version GetVersion()
{
- return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
- }
-};
-
-
-class ModuleNoInviteFactory : public ModuleFactory
-{
- public:
- ModuleNoInviteFactory()
- {
- }
-
- ~ModuleNoInviteFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleNoInvite(Me);
+ return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
}
};
-
-extern "C" void * init_module( void )
-{
- return new ModuleNoInviteFactory;
-}
-
+MODULE_INIT(ModuleNoInvite)