* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
*/
#include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
/* $ModDesc: Prevents users who's nicks are not registered from creating new channels */
ModuleRegOnlyCreate(InspIRCd* Me)
: Module(Me)
{
+ Implementation eventlist[] = { I_OnUserPreJoin };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
}
- void Implements(char* List)
- {
- List[I_OnUserPreJoin] = 1;
- }
- virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
+ virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
{
if (chan)
return 0;
}
};
-
-class ModuleRegOnlyCreateFactory : public ModuleFactory
-{
- public:
- ModuleRegOnlyCreateFactory()
- {
- }
-
- ~ModuleRegOnlyCreateFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleRegOnlyCreate(Me);
- }
-
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
- return new ModuleRegOnlyCreateFactory;
-}
-
+MODULE_INIT(ModuleRegOnlyCreate)