summaryrefslogtreecommitdiff
path: root/src/modules/m_chanprotect.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 23:19:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 23:19:43 +0000
commitb37a253d962ed7af1ea7a328abf2a1af74f30759 (patch)
treea43660b037c817393f7b4ab75071fe4f380f1058 /src/modules/m_chanprotect.cpp
parentf9636a2eff46f6829bf9e01c711ab1ba45a7d50a (diff)
Note: FOR THE MOMENT, this is BROKEN. It wont run right until im done.
Changed Parameter for modules from Server* to InspIRCd*. TODO: Move remaining Server* Modules into InspIRCd* and remove class Server. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4859 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_chanprotect.cpp')
-rw-r--r--src/modules/m_chanprotect.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index 920c34a17..fcb401868 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -19,6 +19,7 @@
#include "modules.h"
#include "helperfuncs.h"
#include "inspircd.h"
+#include "commands.h"
/* $ModDesc: Provides channel modes +a and +q */
@@ -28,11 +29,9 @@ const char* fakevalue = "on";
class ChanFounder : public ModeHandler
{
- Server* Srv;
char* dummyptr;
-
public:
- ChanFounder(InspIRCd* Instance, Server* s) : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
+ ChanFounder(InspIRCd* Instance) : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -86,7 +85,7 @@ class ChanFounder : public ModeHandler
std::string founder = "cm_founder_"+std::string(channel->name);
// source is a server, or ulined, we'll let them +-q the user.
- if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!*source->server) || (!IS_LOCAL(source)))
+ if ((is_uline(source->nick)) || (is_uline(source->server)) || (!*source->server) || (!IS_LOCAL(source)))
{
log(DEBUG,"Allowing remote mode change in ChanFounder");
if (adding)
@@ -144,10 +143,9 @@ class ChanFounder : public ModeHandler
class ChanProtect : public ModeHandler
{
- Server* Srv;
char* dummyptr;
public:
- ChanProtect(InspIRCd* Instance, Server* s) : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
+ ChanProtect(InspIRCd* Instance) : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -196,7 +194,7 @@ class ChanProtect : public ModeHandler
std::string founder = "cm_founder_"+std::string(channel->name);
// source has +q, is a server, or ulined, we'll let them +-a the user.
- if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!*source->server) || (source->GetExt(founder,dummyptr)) || (!IS_LOCAL(source)))
+ if ((is_uline(source->nick)) || (is_uline(source->server)) || (!*source->server) || (source->GetExt(founder,dummyptr)) || (!IS_LOCAL(source)))
{
if (adding)
{
@@ -254,13 +252,13 @@ class ModuleChanProtect : public Module
public:
- ModuleChanProtect(Server* Me) : Module::Module(Me), Srv(Me)
+ ModuleChanProtect(InspIRCd* Me) : Module::Module(Me)
{
/* Initialise module variables */
- cp = new ChanProtect(ServerInstance, Me);
- cf = new ChanFounder(ServerInstance, Me);
-
+ cp = new ChanProtect(ServerInstance);
+ cf = new ChanFounder(ServerInstance);
+
Srv->AddMode(cp, 'a');
Srv->AddMode(cf, 'q');
@@ -470,7 +468,7 @@ class ModuleChanProtectFactory : public ModuleFactory
{
}
- virtual Module * CreateModule(Server* Me)
+ virtual Module * CreateModule(InspIRCd* Me)
{
return new ModuleChanProtect(Me);
}