X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operchans.cpp;h=7f3b989aa32f8216b708c13194cb6c00eb11d889;hb=1afe959c7574b479e4a49a62885d2ac2757025ab;hp=1aace393cc03d11a405361b96dfed6f918f441ba;hpb=e51a4b5c29deac855496d6658a3c4612a61ffbb7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 1aace393c..7f3b989aa 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -16,22 +16,18 @@ using namespace std; -#include #include "users.h" #include "channels.h" #include "modules.h" -#include "helperfuncs.h" #include "inspircd.h" /* $ModDesc: Provides support for oper-only chans via the +O channel mode */ -extern InspIRCd* ServerInstance; - class OperChans : public ModeHandler { public: /* This is an oper-only mode */ - OperChans() : ModeHandler('O', 0, 0, false, MODETYPE_CHANNEL, true) { } + 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) { @@ -58,28 +54,22 @@ class OperChans : public ModeHandler class ModuleOperChans : public Module { - Server* Srv; + OperChans* oc; public: - ModuleOperChans(Server* Me) + ModuleOperChans(InspIRCd* Me) : Module::Module(Me) { - Srv = Me; - // Add a mode +O for channels with no parameters - oc = new OperChans(); - Srv->AddMode(oc, 'O'); + + oc = new OperChans(ServerInstance); + ServerInstance->AddMode(oc, 'O'); } void Implements(char* List) { - List[I_On005Numeric] = List[I_OnUserPreJoin] = 1; + List[I_OnUserPreJoin] = 1; } - - virtual void On005Numeric(std::string &output) - { - ServerInstance->ModeGrok->InsertMode(output,"O",4); - } - + virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { if (!*user->oper) @@ -119,7 +109,7 @@ class ModuleOperChansFactory : public ModuleFactory { } - virtual Module * CreateModule(Server* Me) + virtual Module * CreateModule(InspIRCd* Me) { return new ModuleOperChans(Me); }