#include "channels.h"
#include "modules.h"
#include "helperfuncs.h"
+#include "inspircd.h"
/* $ModDesc: Provides support for oper-only chans via the +O channel mode */
+
+
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)
{
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)
virtual void On005Numeric(std::string &output)
{
- InsertMode(output,"O",4);
+ ServerInstance->ModeGrok->InsertMode(output,"O",4);
}
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
}
- virtual Module * CreateModule(Server* Me)
+ virtual Module * CreateModule(InspIRCd* Me)
{
return new ModuleOperChans(Me);
}