X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_restrictchans.cpp;h=1f2416d4470b32ae82273f07ef686267d1508fcc;hb=e9d1efc1ae29ee86b3c2a42bf56531afac7add6d;hp=27996ffb76415c0ae0a6cdf31c8759196ff9ad60;hpb=3a554ef1e9be9dbcf3de3301a4a6c2938d643bea;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp index 27996ffb7..1f2416d44 100644 --- a/src/modules/m_restrictchans.cpp +++ b/src/modules/m_restrictchans.cpp @@ -6,19 +6,16 @@ * 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 "inspircd.h" #include "users.h" #include "channels.h" #include "modules.h" -#include "inspircd.h" - /* $ModDesc: Only opers may create new channels if this module is loaded */ class ModuleRestrictChans : public Module @@ -43,13 +40,13 @@ class ModuleRestrictChans : public Module public: ModuleRestrictChans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadConfig(); } - virtual void OnRehash(const std::string ¶meter) + virtual void OnRehash(userrec* user, const std::string ¶meter) { ReadConfig(); } @@ -63,7 +60,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 +72,7 @@ class ModuleRestrictChans : public Module return 0; } - virtual ~ModuleRestrictChans() + virtual ~ModuleRestrictChans() { } @@ -85,28 +82,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)