X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operchans.cpp;h=2171db86079963ae0734713f5ee4154537e09a73;hb=2ab88037d8d7d6df3fb9686216a0b36f5ece2313;hp=404a021836a1fd802443d76915bcaff0d382e47c;hpb=76d7e8a0684b38a82e6c05ebd7538b69660e1bef;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 404a02183..2171db860 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -12,9 +12,6 @@ */ #include "inspircd.h" -#include "users.h" -#include "channels.h" -#include "modules.h" /* $ModDesc: Provides support for oper-only chans via the +O channel mode */ @@ -24,7 +21,7 @@ class OperChans : public ModeHandler /* This is an oper-only mode */ OperChans(InspIRCd* Instance) : ModeHandler(Instance, 'O', 0, 0, false, MODETYPE_CHANNEL, true) { } - ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { if (adding) { @@ -57,7 +54,7 @@ class ModuleOperChans : public Module { oc = new OperChans(ServerInstance); - if (!ServerInstance->AddMode(oc, 'O')) + if (!ServerInstance->AddMode(oc)) throw ModuleException("Could not add new modes!"); } @@ -66,7 +63,7 @@ class ModuleOperChans : public Module 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 (!IS_OPER(user)) { @@ -94,28 +91,4 @@ class ModuleOperChans : public Module } }; - -class ModuleOperChansFactory : public ModuleFactory -{ - public: - ModuleOperChansFactory() - { - } - - ~ModuleOperChansFactory() - { - } - - virtual Module * CreateModule(InspIRCd* Me) - { - return new ModuleOperChans(Me); - } - -}; - - -extern "C" DllExport void * init_module( void ) -{ - return new ModuleOperChansFactory; -} - +MODULE_INIT(ModuleOperChans)