summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp9
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp9
-rw-r--r--src/modules/m_banexception.cpp4
-rw-r--r--src/modules/m_blockcaps.cpp4
-rw-r--r--src/modules/m_blockcolor.cpp4
-rw-r--r--src/modules/m_botmode.cpp4
-rw-r--r--src/modules/m_censor.cpp8
-rw-r--r--src/modules/m_chanfilter.cpp4
-rw-r--r--src/modules/m_chanprotect.cpp8
-rw-r--r--src/modules/m_cloaking.cpp4
-rw-r--r--src/modules/m_globops.cpp4
-rw-r--r--src/modules/m_helpop.cpp4
-rw-r--r--src/modules/m_inviteexception.cpp4
-rw-r--r--src/modules/m_joinflood.cpp4
-rw-r--r--src/modules/m_kicknorejoin.cpp4
-rw-r--r--src/modules/m_knock.cpp4
-rw-r--r--src/modules/m_messageflood.cpp4
-rw-r--r--src/modules/m_noctcp.cpp4
-rw-r--r--src/modules/m_noinvite.cpp4
-rw-r--r--src/modules/m_nokicks.cpp4
-rw-r--r--src/modules/m_nonicks.cpp4
-rw-r--r--src/modules/m_nonotice.cpp4
-rw-r--r--src/modules/m_operchans.cpp7
-rw-r--r--src/modules/m_redirect.cpp4
-rw-r--r--src/modules/m_services.cpp20
-rw-r--r--src/modules/m_services_account.cpp12
-rw-r--r--src/modules/m_showwhois.cpp6
-rw-r--r--src/modules/m_sslmodes.cpp5
-rw-r--r--src/modules/m_stripcolor.cpp8
29 files changed, 87 insertions, 81 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 9bb92fd61..a5cdaf3e0 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -48,7 +48,7 @@ class ModuleSSLGnuTLS : public Module
char* dummy;
- CullList culllist;
+ CullList* culllist;
std::vector<int> listenports;
@@ -70,6 +70,8 @@ class ModuleSSLGnuTLS : public Module
: Module::Module(Me)
{
Srv = Me;
+
+ culllist = new CullList(ServerInstance);
// Not rehashable...because I cba to reduce all the sizes of existing buffers.
inbufsize = ServerInstance->Config->NetBufferSize;
@@ -196,6 +198,7 @@ class ModuleSSLGnuTLS : public Module
gnutls_dh_params_deinit(dh_params);
gnutls_certificate_free_credentials(x509_cred);
gnutls_global_deinit();
+ delete culllist;
}
virtual void OnCleanup(int target_type, void* item)
@@ -209,7 +212,7 @@ class ModuleSSLGnuTLS : public Module
// User is using SSL, they're a local user, and they're using one of *our* SSL ports.
// Potentially there could be multiple SSL modules loaded at once on different ports.
log(DEBUG, "m_ssl_gnutls.so: Adding user %s to cull list", user->nick);
- culllist.AddItem(user, "SSL module unloading");
+ culllist->AddItem(user, "SSL module unloading");
}
}
}
@@ -219,7 +222,7 @@ class ModuleSSLGnuTLS : public Module
if(mod == this)
{
// We're being unloaded, kill all the users added to the cull list in OnCleanup
- int numusers = culllist.Apply();
+ int numusers = culllist->Apply();
log(DEBUG, "m_ssl_gnutls.so: Killed %d users for unload of GnuTLS SSL module", numusers);
for(unsigned int i = 0; i < listenports.size(); i++)
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index f9f38fc17..7d10b78be 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -62,7 +62,7 @@ class ModuleSSLOpenSSL : public Module
Server* Srv;
ConfigReader* Conf;
- CullList culllist;
+ CullList* culllist;
std::vector<int> listenports;
@@ -85,6 +85,8 @@ class ModuleSSLOpenSSL : public Module
: Module::Module(Me)
{
Srv = Me;
+
+ culllist = new CullList(ServerInstance);
// Not rehashable...because I cba to reduce all the sizes of existing buffers.
inbufsize = ServerInstance->Config->NetBufferSize;
@@ -220,6 +222,7 @@ class ModuleSSLOpenSSL : public Module
virtual ~ModuleSSLOpenSSL()
{
SSL_CTX_free(ctx);
+ delete culllist;
}
virtual void OnCleanup(int target_type, void* item)
@@ -233,7 +236,7 @@ class ModuleSSLOpenSSL : public Module
// User is using SSL, they're a local user, and they're using one of *our* SSL ports.
// Potentially there could be multiple SSL modules loaded at once on different ports.
log(DEBUG, "m_ssl_openssl.so: Adding user %s to cull list", user->nick);
- culllist.AddItem(user, "SSL module unloading");
+ culllist->AddItem(user, "SSL module unloading");
}
}
}
@@ -243,7 +246,7 @@ class ModuleSSLOpenSSL : public Module
if(mod == this)
{
// We're being unloaded, kill all the users added to the cull list in OnCleanup
- int numusers = culllist.Apply();
+ int numusers = culllist->Apply();
log(DEBUG, "m_ssl_openssl.so: Killed %d users for unload of OpenSSL SSL module", numusers);
for(unsigned int i = 0; i < listenports.size(); i++)
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp
index 588c42b5e..0c56edd7e 100644
--- a/src/modules/m_banexception.cpp
+++ b/src/modules/m_banexception.cpp
@@ -23,7 +23,7 @@ extern InspIRCd* ServerInstance;
class BanException : public ListModeBase
{
public:
- BanException(Server* serv) : ListModeBase(serv, 'e', "End of Channel Exception List", "348", "349", true) { }
+ BanException(InspIRCd* Instance, Server* serv) : ListModeBase(Instance, serv, 'e', "End of Channel Exception List", "348", "349", true) { }
};
@@ -36,7 +36,7 @@ public:
ModuleBanException(Server* serv)
: Module::Module(serv)
{
- be = new BanException(serv);
+ be = new BanException(ServerInstance, serv);
Srv = serv;
Srv->AddMode(be, 'e');
}
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index 8cc3d8646..76d535380 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -29,7 +29,7 @@ extern InspIRCd* ServerInstance;
class BlockCaps : public ModeHandler
{
public:
- BlockCaps() : ModeHandler('P', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ BlockCaps(InspIRCd* Instance) : ModeHandler(Instance, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -63,7 +63,7 @@ public:
ModuleBlockCAPS(Server* Me) : Module::Module(Me)
{
Srv = Me;
- bc = new BlockCaps;
+ bc = new BlockCaps(ServerInstance);
Srv->AddMode(bc, 'P');
}
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index 75d86bba0..4ededb4a3 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -31,7 +31,7 @@ extern InspIRCd* ServerInstance;
class BlockColor : public ModeHandler
{
public:
- BlockColor() : ModeHandler('c', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ BlockColor(InspIRCd* Instance) : ModeHandler(Instance, 'c', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -65,7 +65,7 @@ class ModuleBlockColour : public Module
ModuleBlockColour(Server* Me) : Module::Module(Me)
{
Srv = Me;
- bc = new BlockColor();
+ bc = new BlockColor(ServerInstance);
Srv->AddMode(bc, 'c');
}
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp
index 0f402a1ed..b33e63e19 100644
--- a/src/modules/m_botmode.cpp
+++ b/src/modules/m_botmode.cpp
@@ -32,7 +32,7 @@ extern InspIRCd* ServerInstance;
class BotMode : public ModeHandler
{
public:
- BotMode() : ModeHandler('B', 0, 0, false, MODETYPE_USER, false) { }
+ BotMode(InspIRCd* Instance) : ModeHandler(Instance, 'B', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -70,7 +70,7 @@ class ModuleBotMode : public Module
: Module::Module(Me)
{
Srv = Me;
- bm = new BotMode();
+ bm = new BotMode(ServerInstance);
Srv->AddMode(bm, 'B');
}
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index deeb68685..4bc5b43e5 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -42,7 +42,7 @@ class CensorException : public ModuleException
class CensorUser : public ModeHandler
{
public:
- CensorUser() : ModeHandler('G', 0, 0, false, MODETYPE_USER, false) { }
+ CensorUser(InspIRCd* Instance) : ModeHandler(Instance, 'G', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -74,7 +74,7 @@ class CensorUser : public ModeHandler
class CensorChannel : public ModeHandler
{
public:
- CensorChannel() : ModeHandler('G', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ CensorChannel(InspIRCd* Instance) : ModeHandler(Instance, 'G', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -125,8 +125,8 @@ class ModuleCensor : public Module
*/
Srv = Me;
OnRehash("");
- cu = new CensorUser;
- cc = new CensorChannel;
+ cu = new CensorUser(ServerInstance);
+ cc = new CensorChannel(ServerInstance);
Srv->AddMode(cu, 'G');
Srv->AddMode(cc, 'G');
}
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index 22442de98..6756fd8ec 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -34,7 +34,7 @@ extern InspIRCd* ServerInstance;
class ChanFilter : public ListModeBase
{
public:
- ChanFilter(Server* serv) : ListModeBase(serv, 'g', "End of channel spamfilter list", "941", "940", false, "chanfilter") { }
+ ChanFilter(InspIRCd* Instance, Server* serv) : ListModeBase(Instance, serv, 'g', "End of channel spamfilter list", "941", "940", false, "chanfilter") { }
virtual bool ValidateParam(userrec* user, chanrec* chan, std::string &word)
{
@@ -74,7 +74,7 @@ class ModuleChanFilter : public Module
ModuleChanFilter(Server* Me)
: Module::Module(Me), Srv(Me)
{
- cf = new ChanFilter(Srv);
+ cf = new ChanFilter(ServerInstance, Srv);
Srv->AddMode(cf, 'g');
}
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index 024887792..920c34a17 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -32,7 +32,7 @@ class ChanFounder : public ModeHandler
char* dummyptr;
public:
- ChanFounder(Server* s) : ModeHandler('q', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
+ ChanFounder(InspIRCd* Instance, Server* s) : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -147,7 +147,7 @@ class ChanProtect : public ModeHandler
Server* Srv;
char* dummyptr;
public:
- ChanProtect(Server* s) : ModeHandler('a', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
+ ChanProtect(InspIRCd* Instance, Server* s) : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -258,8 +258,8 @@ class ModuleChanProtect : public Module
{
/* Initialise module variables */
- cp = new ChanProtect(Me);
- cf = new ChanFounder(Me);
+ cp = new ChanProtect(ServerInstance, Me);
+ cf = new ChanFounder(ServerInstance, Me);
Srv->AddMode(cp, 'a');
Srv->AddMode(cf, 'q');
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 92fac501e..f3b5bcb7e 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -285,7 +285,7 @@ class CloakUser : public ModeHandler
}
public:
- CloakUser(Server* Me) : ModeHandler('x', 0, 0, false, MODETYPE_USER, false), Srv(Me) { }
+ CloakUser(InspIRCd* Instance, Server* Me) : ModeHandler(Instance, 'x', 0, 0, false, MODETYPE_USER, false), Srv(Me) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -406,7 +406,7 @@ class ModuleCloaking : public Module
: Module::Module(Me), Srv(Me)
{
/* Create new mode handler object */
- cu = new CloakUser(Srv);
+ cu = new CloakUser(ServerInstance, Srv);
/* Register it with the core */
Srv->AddMode(cu, 'x');
diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp
index a02ad1172..289522d7f 100644
--- a/src/modules/m_globops.cpp
+++ b/src/modules/m_globops.cpp
@@ -53,7 +53,7 @@ class cmd_globops : public command_t
class ModeGlobops : public ModeHandler
{
public:
- ModeGlobops() : ModeHandler('g', 0, 0, false, MODETYPE_USER, true) { }
+ ModeGlobops(InspIRCd* Instance) : ModeHandler(Instance, 'g', 0, 0, false, MODETYPE_USER, true) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -88,7 +88,7 @@ class ModuleGlobops : public Module
: Module::Module(Me)
{
Srv = Me;
- mg = new ModeGlobops();
+ mg = new ModeGlobops(ServerInstance);
Srv->AddMode(mg, 'g');
mycommand = new cmd_globops();
Srv->AddCommand(mycommand);
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 00ba05c24..d0ec1a0aa 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -36,7 +36,7 @@ void sendtohelpop(userrec*, int, const char**);
class Helpop : public ModeHandler
{
public:
- Helpop() : ModeHandler('h', 0, 0, false, MODETYPE_USER, true) { }
+ Helpop(InspIRCd* Instance) : ModeHandler(Instance, 'h', 0, 0, false, MODETYPE_USER, true) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -207,7 +207,7 @@ class ModuleHelpop : public Module
Srv = Me;
ReadConfig();
- ho = new Helpop();
+ ho = new Helpop(ServerInstance);
Srv->AddMode(ho, 'h');
mycommand = new cmd_helpop();
Srv->AddCommand(mycommand);
diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp
index 5bd8d17e6..f3e278e98 100644
--- a/src/modules/m_inviteexception.cpp
+++ b/src/modules/m_inviteexception.cpp
@@ -24,7 +24,7 @@ class InspIRCd* ServerInstance;
class InviteException : public ListModeBase
{
public:
- InviteException(Server* serv) : ListModeBase(serv, 'I', "End of Channel Invite Exception List", "346", "347", true) { }
+ InviteException(InspIRCd* Instance, Server* serv) : ListModeBase(Instance, serv, 'I', "End of Channel Invite Exception List", "346", "347", true) { }
};
class ModuleInviteException : public Module
@@ -35,7 +35,7 @@ class ModuleInviteException : public Module
public:
ModuleInviteException(Server* serv) : Module(serv)
{
- ie = new InviteException(serv);
+ ie = new InviteException(ServerInstance, serv);
Srv = serv;
Srv->AddMode(ie, 'I');
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 60794c804..3adbb5332 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -101,7 +101,7 @@ class joinfloodsettings : public classbase
class JoinFlood : public ModeHandler
{
public:
- JoinFlood() : ModeHandler('j', 1, 0, false, MODETYPE_CHANNEL, false) { }
+ JoinFlood(InspIRCd* Instance) : ModeHandler(Instance, 'j', 1, 0, false, MODETYPE_CHANNEL, false) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -197,7 +197,7 @@ class ModuleJoinFlood : public Module
: Module::Module(Me)
{
Srv = Me;
- jf = new JoinFlood();
+ jf = new JoinFlood(ServerInstance);
Srv->AddMode(jf, 'j');
}
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 268b8d5f7..811a51725 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -25,7 +25,7 @@ typedef std::map<userrec*, time_t> delaylist;
class KickRejoin : public ModeHandler
{
public:
- KickRejoin() : ModeHandler('J', 1, 0, false, MODETYPE_CHANNEL, false) { }
+ KickRejoin(InspIRCd* Instance) : ModeHandler(Instance, 'J', 1, 0, false, MODETYPE_CHANNEL, false) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -79,7 +79,7 @@ public:
: Module::Module(Me)
{
Srv = Me;
- kr = new KickRejoin();
+ kr = new KickRejoin(ServerInstance);
Srv->AddMode(kr, 'J');
}
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index ce956b9e0..1272f2be8 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -80,7 +80,7 @@ class cmd_knock : public command_t
class Knock : public ModeHandler
{
public:
- Knock() : ModeHandler('K', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ Knock(InspIRCd* Instance) : ModeHandler(Instance, 'K', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -113,7 +113,7 @@ class ModuleKnock : public Module
ModuleKnock(Server* Me) : Module::Module(Me)
{
Srv = Me;
- kn = new Knock();
+ kn = new Knock(ServerInstance);
Srv->AddMode(kn, 'K');
mycommand = new cmd_knock();
Srv->AddCommand(mycommand);
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 7dfe9b943..9049eca8c 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -89,7 +89,7 @@ class floodsettings : public classbase
class MsgFlood : public ModeHandler
{
public:
- MsgFlood() : ModeHandler('f', 1, 0, false, MODETYPE_CHANNEL, false) { }
+ MsgFlood(InspIRCd* Instance) : ModeHandler(Instance, 'f', 1, 0, false, MODETYPE_CHANNEL, false) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -195,7 +195,7 @@ class ModuleMsgFlood : public Module
: Module::Module(Me)
{
Srv = Me;
- mf = new MsgFlood();
+ mf = new MsgFlood(ServerInstance);
Srv->AddMode(mf, 'f');
}
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index dd35f88a8..fc7ede256 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -30,7 +30,7 @@ extern InspIRCd* ServerInstance;
class NoCTCP : public ModeHandler
{
public:
- NoCTCP() : ModeHandler('C', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ NoCTCP(InspIRCd* Instance) : ModeHandler(Instance, 'C', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -66,7 +66,7 @@ class ModuleNoCTCP : public Module
: Module::Module(Me)
{
Srv = Me;
- nc = new NoCTCP();
+ nc = new NoCTCP(ServerInstance);
Srv->AddMode(nc, 'C');
}
diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp
index 1d14f1c9b..1481f5f03 100644
--- a/src/modules/m_noinvite.cpp
+++ b/src/modules/m_noinvite.cpp
@@ -30,7 +30,7 @@ extern InspIRCd* ServerInstance;
class NoInvite : public ModeHandler
{
public:
- NoInvite() : ModeHandler('V', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ NoInvite(InspIRCd* Instance) : ModeHandler(Instance, 'V', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -65,7 +65,7 @@ class ModuleNoInvite : public Module
ModuleNoInvite(Server* Me) : Module::Module(Me)
{
Srv = Me;
- ni = new NoInvite();
+ ni = new NoInvite(ServerInstance);
Srv->AddMode(ni, 'V');
}
diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp
index c1151472d..be06cd79c 100644
--- a/src/modules/m_nokicks.cpp
+++ b/src/modules/m_nokicks.cpp
@@ -30,7 +30,7 @@ extern InspIRCd* ServerInstance;
class NoKicks : public ModeHandler
{
public:
- NoKicks() : ModeHandler('Q', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ NoKicks(InspIRCd* Instance) : ModeHandler(Instance, 'Q', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -66,7 +66,7 @@ class ModuleNoKicks : public Module
: Module::Module(Me)
{
Srv = Me;
- nk = new NoKicks();
+ nk = new NoKicks(ServerInstance);
Srv->AddMode(nk, 'Q');
}
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 7b134b71e..1e8b7ccf9 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -33,7 +33,7 @@ extern InspIRCd* ServerInstance;
class NoNicks : public ModeHandler
{
public:
- NoNicks() : ModeHandler('N', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ NoNicks(InspIRCd* Instance) : ModeHandler(Instance, 'N', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -68,7 +68,7 @@ class ModuleNoNickChange : public Module
: Module::Module(Me)
{
Srv = Me;
- nn = new NoNicks();
+ nn = new NoNicks(ServerInstance);
Srv->AddMode(nn, 'N');
}
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index 7a2229ccd..34c59db88 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -30,7 +30,7 @@ extern InspIRCd* ServerInstance;
class NoNotice : public ModeHandler
{
public:
- NoNotice() : ModeHandler('T', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ NoNotice(InspIRCd* Instance) : ModeHandler(Instance, 'T', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -65,7 +65,7 @@ class ModuleNoNotice : public Module
: Module::Module(Me)
{
Srv = Me;
- nt = new NoNotice();
+ nt = new NoNotice(ServerInstance);
Srv->AddMode(nt, 'T');
}
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 1aace393c..f78bb5e36 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -31,7 +31,7 @@ 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 &parameter, bool adding)
{
@@ -64,9 +64,8 @@ class ModuleOperChans : public Module
ModuleOperChans(Server* Me)
: Module::Module(Me)
{
- Srv = Me;
- // Add a mode +O for channels with no parameters
- oc = new OperChans();
+ Srv = Me;
+ oc = new OperChans(ServerInstance);
Srv->AddMode(oc, 'O');
}
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 8a917e4ba..8e7cefb93 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -31,7 +31,7 @@ class Redirect : public ModeHandler
{
Server* Srv;
public:
- Redirect(Server* s) : ModeHandler('L', 1, 0, false, MODETYPE_CHANNEL, false), Srv(s) { }
+ Redirect(InspIRCd* Instance, Server* s) : ModeHandler(Instance, 'L', 1, 0, false, MODETYPE_CHANNEL, false), Srv(s) { }
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@@ -115,7 +115,7 @@ class ModuleRedirect : public Module
: Module::Module(Me)
{
Srv = Me;
- re = new Redirect(Me);
+ re = new Redirect(ServerInstance, Me);
Srv->AddMode(re, 'L');
}
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index 33748450d..0fc9f1e9d 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -35,7 +35,7 @@ class Channel_r : public ModeHandler
{
Server* Srv;
public:
- Channel_r(Server* srv) : ModeHandler('r', 0, 0, false, MODETYPE_CHANNEL, false), Srv(srv) { }
+ Channel_r(InspIRCd* Instance, Server* srv) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_CHANNEL, false), Srv(srv) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -59,7 +59,7 @@ class User_r : public ModeHandler
{
Server* Srv;
public:
- User_r(Server* srv) : ModeHandler('r', 0, 0, false, MODETYPE_USER, false), Srv(srv) { }
+ User_r(InspIRCd* Instance, Server* srv) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_USER, false), Srv(srv) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -81,7 +81,7 @@ class User_r : public ModeHandler
class Channel_R : public ModeHandler
{
public:
- Channel_R() : ModeHandler('R', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ Channel_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -109,7 +109,7 @@ class Channel_R : public ModeHandler
class User_R : public ModeHandler
{
public:
- User_R() : ModeHandler('R', 0, 0, false, MODETYPE_USER, false) { }
+ User_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -137,7 +137,7 @@ class User_R : public ModeHandler
class Channel_M : public ModeHandler
{
public:
- Channel_M() : ModeHandler('M', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ Channel_M(InspIRCd* Instance) : ModeHandler(Instance, 'M', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -175,11 +175,11 @@ class ModuleServices : public Module
: Module::Module(Me)
{
Srv = Me;
- m1 = new Channel_r(Me);
- m2 = new Channel_R();
- m3 = new Channel_M();
- m4 = new User_r(Me);
- m5 = new User_R();
+ m1 = new Channel_r(ServerInstance, Me);
+ m2 = new Channel_R(ServerInstance);
+ m3 = new Channel_M(ServerInstance);
+ m4 = new User_r(ServerInstance, Me);
+ m5 = new User_R(ServerInstance);
Srv->AddMode(m1, 'r');
Srv->AddMode(m2, 'R');
Srv->AddMode(m3, 'M');
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index d712a0ec7..19e010b69 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -32,7 +32,7 @@ extern InspIRCd* ServerInstance;
class AChannel_R : public ModeHandler
{
public:
- AChannel_R() : ModeHandler('R', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ AChannel_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -60,7 +60,7 @@ class AChannel_R : public ModeHandler
class AUser_R : public ModeHandler
{
public:
- AUser_R() : ModeHandler('R', 0, 0, false, MODETYPE_USER, false) { }
+ AUser_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -88,7 +88,7 @@ class AUser_R : public ModeHandler
class AChannel_M : public ModeHandler
{
public:
- AChannel_M() : ModeHandler('M', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ AChannel_M(InspIRCd* Instance) : ModeHandler(Instance, 'M', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -123,9 +123,9 @@ class ModuleServicesAccount : public Module
ModuleServicesAccount(Server* Me) : Module::Module(Me)
{
Srv = Me;
- m1 = new AChannel_R();
- m2 = new AChannel_M();
- m3 = new AUser_R();
+ m1 = new AChannel_R(ServerInstance);
+ m2 = new AChannel_M(ServerInstance);
+ m3 = new AUser_R(ServerInstance);
Srv->AddMode(m1, 'R');
Srv->AddMode(m2, 'M');
Srv->AddMode(m3, 'R');
diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp
index 1343e665f..33f59e756 100644
--- a/src/modules/m_showwhois.cpp
+++ b/src/modules/m_showwhois.cpp
@@ -11,10 +11,12 @@ using namespace std;
/* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
+extern InspIRCd* ServerInstance;
+
class SeeWhois : public ModeHandler
{
public:
- SeeWhois() : ModeHandler('W', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -53,7 +55,7 @@ class ModuleShowwhois : public Module
ModuleShowwhois(Server* Me) : Module::Module(Me)
{
Srv = Me;
- sw = new SeeWhois();
+ sw = new SeeWhois(ServerInstance);
Srv->AddMode(sw, 'W');
}
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index c844e4e01..bc4679fd7 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -12,9 +12,8 @@ extern InspIRCd* ServerInstance;
class SSLMode : public ModeHandler
{
- Server* Srv;
public:
- SSLMode(Server* s) : ModeHandler('z', 0, 0, false, MODETYPE_CHANNEL, false), Srv(s) { }
+ SSLMode(InspIRCd* Instance) : ModeHandler(Instance, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -66,7 +65,7 @@ class ModuleSSLModes : public Module
{
Srv = Me;
- sslm = new SSLMode(Me);
+ sslm = new SSLMode(ServerInstance);
Srv->AddMode(sslm, 'z');
}
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 05ffd201c..d6b04dd58 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -31,7 +31,7 @@ extern InspIRCd* ServerInstance;
class ChannelStripColor : public ModeHandler
{
public:
- ChannelStripColor() : ModeHandler('S', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ ChannelStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -63,7 +63,7 @@ class ChannelStripColor : public ModeHandler
class UserStripColor : public ModeHandler
{
public:
- UserStripColor() : ModeHandler('S', 0, 0, false, MODETYPE_USER, false) { }
+ UserStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
@@ -106,8 +106,8 @@ class ModuleStripColor : public Module
{
Srv = Me;
- usc = new UserStripColor();
- csc = new ChannelStripColor();
+ usc = new UserStripColor(ServerInstance);
+ csc = new ChannelStripColor(ServerInstance);
Srv->AddMode(usc, 'S');
Srv->AddMode(csc, 'S');