X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_restrictchans.cpp;h=69e5038612f61e9029e36f1836a18df2fcc594c4;hb=e6d000042ea75d4e0485bec9564b47163a3ca414;hp=fc83d2e5933c9f20429b839173a1085695b57bf8;hpb=42d5b9571eff06b0c33093dc9118c29f9603fd2b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp index fc83d2e59..69e503861 100644 --- a/src/modules/m_restrictchans.cpp +++ b/src/modules/m_restrictchans.cpp @@ -6,17 +6,11 @@ * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see - * the file COPYING for details. + * the file COPYING for details. * * --------------------------------------------------- */ -#include -#include -#include "users.h" -#include "channels.h" -#include "modules.h" - #include "inspircd.h" /* $ModDesc: Only opers may create new channels if this module is loaded */ @@ -43,7 +37,7 @@ class ModuleRestrictChans : public Module public: ModuleRestrictChans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadConfig(); @@ -63,7 +57,7 @@ class ModuleRestrictChans : public Module { irc::string x = cname; // user is not an oper and its not in the allow list - if ((!*user->oper) && (allowchans.find(x) == allowchans.end())) + if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end())) { // channel does not yet exist (record is null, about to be created IF we were to allow it) if (!chan) @@ -75,7 +69,7 @@ class ModuleRestrictChans : public Module return 0; } - virtual ~ModuleRestrictChans() + virtual ~ModuleRestrictChans() { } @@ -85,28 +79,4 @@ class ModuleRestrictChans : public Module } }; - -class ModuleRestrictChansFactory : public ModuleFactory -{ - public: - ModuleRestrictChansFactory() - { - } - - ~ModuleRestrictChansFactory() - { - } - - virtual Module * CreateModule(InspIRCd* Me) - { - return new ModuleRestrictChans(Me); - } - -}; - - -extern "C" void * init_module( void ) -{ - return new ModuleRestrictChansFactory; -} - +MODULE_INIT(ModuleRestrictChans)