summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp4
-rw-r--r--src/modules/extra/m_sqlauth.cpp6
-rw-r--r--src/modules/m_blockamsg.cpp3
-rw-r--r--src/modules/m_conn_waitpong.cpp4
-rw-r--r--src/modules/m_connflood.cpp8
-rw-r--r--src/modules/m_filter.cpp4
-rw-r--r--src/modules/m_nicklock.cpp3
-rw-r--r--src/modules/m_operjoin.cpp4
-rw-r--r--src/modules/m_park.cpp2
-rw-r--r--src/modules/m_redirect.cpp2
-rw-r--r--src/modules/m_sajoin.cpp3
-rw-r--r--src/modules/m_samode.cpp3
-rw-r--r--src/modules/m_sanick.cpp3
-rw-r--r--src/modules/m_saquit.cpp3
-rw-r--r--src/modules/m_spanningtree.cpp18
-rw-r--r--src/modules/m_timedbans.cpp5
16 files changed, 48 insertions, 27 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index da7559914..08068db59 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -29,6 +29,8 @@ using namespace std;
#include "helperfuncs.h"
#include "inspircd.h"
+extern InspIRCd* ServerInstance;
+
class FilterPCREException : public ModuleException
{
public:
@@ -145,7 +147,7 @@ class ModuleFilterPCRE : public Module
if (do_action == "kill")
{
- userrec::QuitUser(user,reason);
+ userrec::QuitUser(ServerInstance,user,reason);
}
return 1;
}
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index e6878777d..93d763cb5 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -27,6 +27,8 @@
/* $ModDesc: Allow/Deny connections based upon an arbitary SQL table */
+extern InspIRCd* ServerInstance;
+
class ModuleSQLAuth : public Module
{
Server* Srv;
@@ -94,7 +96,7 @@ public:
if (!CheckCredentials(user))
{
- userrec::QuitUser(user,killreason);
+ userrec::QuitUser(ServerInstance,user,killreason);
}
}
@@ -202,7 +204,7 @@ public:
{
if(user->GetExt("sqlauth_failed"))
{
- userrec::QuitUser(user,killreason);
+ userrec::QuitUser(ServerInstance,user,killreason);
return false;
}
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index 97c255501..9567f2de7 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -30,6 +30,7 @@
/* $ModDesc: Attempt to block /amsg, at least some of the irritating mIRC scripts. */
extern time_t TIME;
+extern InspIRCd* ServerInstance;
enum BlockAction { IBLOCK_KILL, IBLOCK_KILLOPERS, IBLOCK_NOTICE, IBLOCK_NOTICEOPERS, IBLOCK_SILENT };
@@ -142,7 +143,7 @@ public:
WriteOpers("*** %s had an /amsg or /ame denied", user->nick);
if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS)
- userrec::QuitUser(user, "Global message (/amsg or /ame) detected");
+ userrec::QuitUser(ServerInstance, user, "Global message (/amsg or /ame) detected");
else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick);
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp
index 6021d7058..558e98696 100644
--- a/src/modules/m_conn_waitpong.cpp
+++ b/src/modules/m_conn_waitpong.cpp
@@ -9,6 +9,8 @@
/* $ModDesc: Forces connecting clients to send a PONG message back to the server before they can complete their connection */
+extern InspIRCd* ServerInstance;
+
char* RandString(unsigned int length)
{
unsigned char* tmp = new unsigned char[(length/4)*3];
@@ -95,7 +97,7 @@ class ModuleWaitPong : public Module
else
{
if(killonbadreply)
- userrec::QuitUser(user, "Incorrect ping reply for registration");
+ userrec::QuitUser(ServerInstance, user, "Incorrect ping reply for registration");
return 1;
}
}
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index e5d3fd2ad..b1a9d8c7c 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -20,12 +20,16 @@ using namespace std;
#include "users.h"
#include "modules.h"
+#include "helperfuncs.h"
+#include "inspircd.h"
/* $ModDesc: Connection throttle */
int conns = 0, throttled = 0;
extern time_t TIME;
+extern InspIRCd* ServerInstance;
+
class ModuleConnFlood : public Module
{
private:
@@ -94,7 +98,7 @@ public:
Srv->SendOpers("*** Connection throttle deactivated");
return;
}
- userrec::QuitUser(user, quitmsg);
+ userrec::QuitUser(ServerInstance, user, quitmsg);
return;
}
@@ -104,7 +108,7 @@ public:
{
throttled = 1;
Srv->SendOpers("*** Connection throttle activated");
- userrec::QuitUser(user, quitmsg);
+ userrec::QuitUser(ServerInstance, user, quitmsg);
return;
}
}
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 9b4a12e39..0f9477921 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -30,6 +30,8 @@ using namespace std;
/* $ModDesc: An enhanced version of the unreal m_filter.so used by chatspike.net */
+extern InspIRCd* ServerInstance;
+
class Filter : public classbase
{
public:
@@ -117,7 +119,7 @@ class ModuleFilter : public Module
if (f->action == "kill")
{
- userrec::QuitUser(user,f->reason);
+ userrec::QuitUser(ServerInstance,user,f->reason);
}
return 1;
}
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp
index 6369e34d7..e46b56901 100644
--- a/src/modules/m_nicklock.cpp
+++ b/src/modules/m_nicklock.cpp
@@ -27,6 +27,7 @@ using namespace std;
/* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */
static Server *Srv;
+extern InspIRCd* ServerInstance;
class cmd_nicklock : public command_t
{
@@ -57,7 +58,7 @@ class cmd_nicklock : public command_t
Srv->SendOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+std::string(parameters[0])+" to "+parameters[1]);
if (!source->ForceNickChange(parameters[1]))
{
- userrec::QuitUser(source, "Nickname collision");
+ userrec::QuitUser(ServerInstance, source, "Nickname collision");
return;
}
source->Extend("nick_locked", "ON");
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 801e0ac10..750f98c96 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -10,6 +10,8 @@ using namespace std;
/* $ModDesc: Forces opers to join the specified channel(s) on oper-up */
+extern InspIRCd* ServerInstance;
+
class ModuleOperjoin : public Module
{
private:
@@ -73,7 +75,7 @@ class ModuleOperjoin : public Module
std::vector<std::string> operChans;
tokenize(operChan,operChans);
for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
- chanrec::JoinUser(user, it->c_str(), false);
+ chanrec::JoinUser(ServerInstance, user, it->c_str(), false);
}
}
diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp
index 779a4e8a0..8502fbfdb 100644
--- a/src/modules/m_park.cpp
+++ b/src/modules/m_park.cpp
@@ -328,7 +328,7 @@ class ModulePark : public Module
// and then corrupt the pointer!
pinfo.erase(j);
if (thisnick)
- userrec::QuitUser(thisnick,"PARK timeout");
+ userrec::QuitUser(ServerInstance,thisnick,"PARK timeout");
go_again = true;
break;
}
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index d7f82f38e..4d8d717ab 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -139,7 +139,7 @@ class ModuleRedirect : public Module
{
std::string channel = chan->GetModeParameter('L');
user->WriteServ("470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel.c_str());
- chanrec::JoinUser(user, channel.c_str(), false);
+ chanrec::JoinUser(ServerInstance, user, channel.c_str(), false);
return 1;
}
}
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 54f9ad066..af03f47d7 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -27,6 +27,7 @@ using namespace std;
/* $ModDesc: Provides support for unreal-style SAJOIN command */
static Server *Srv;
+extern InspIRCd* ServerInstance;
class cmd_sajoin : public command_t
{
@@ -55,7 +56,7 @@ class cmd_sajoin : public command_t
}
Srv->SendOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
- chanrec::JoinUser(dest, parameters[1], true);
+ chanrec::JoinUser(ServerInstance, dest, parameters[1], true);
}
}
};
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index 3e6c256a0..012bfed89 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -38,6 +38,7 @@ using namespace std;
#include "inspircd.h"
static Server *Srv;
+extern InspIRCd* ServerInstance;
class cmd_samode : public command_t
{
@@ -55,7 +56,7 @@ class cmd_samode : public command_t
*/
std::string result;
Srv->Log(DEBUG,"SAMODE: Being handled");
- userrec* n = new userrec();
+ userrec* n = new userrec(ServerInstance);
n->fd = FD_MAGIC_NUMBER;
Srv->SendMode(parameters,pcnt,n);
delete n;
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index 1299332fe..db35b9ba5 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -25,6 +25,7 @@ using namespace std;
/* $ModDesc: Provides support for SANICK command */
+extern InspIRCd* ServerInstance;
static Server *Srv;
class cmd_sanick : public command_t
@@ -54,7 +55,7 @@ class cmd_sanick : public command_t
if (!source->ForceNickChange(parameters[1]))
{
/* We couldnt change the nick */
- userrec::QuitUser(source, "Nickname collision");
+ userrec::QuitUser(ServerInstance, source, "Nickname collision");
return;
}
}
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp
index 3c9d95189..dd02d4e41 100644
--- a/src/modules/m_saquit.cpp
+++ b/src/modules/m_saquit.cpp
@@ -36,6 +36,7 @@ using namespace std;
/* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */
static Server *Srv;
+extern InspIRCd* ServerInstance;
class cmd_saquit : public command_t
{
@@ -64,7 +65,7 @@ class cmd_saquit : public command_t
line = line + std::string(parameters[pcnt-1]);
Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line);
- userrec::QuitUser(dest, line);
+ userrec::QuitUser(ServerInstance, dest, line);
}
}
};
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 3206c5621..75fa76489 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -325,7 +325,7 @@ class TreeServer : public classbase
userrec* a = (userrec*)*n;
log(DEBUG,"Kill %s fd=%d",a->nick,a->fd);
if (!IS_LOCAL(a))
- userrec::QuitUser(a,reason_s);
+ userrec::QuitUser(ServerInstance,a,reason_s);
}
return time_to_die.size();
}
@@ -945,7 +945,7 @@ class TreeSocket : public InspSocket
else
{
/* FMODE from a server, create a fake user to receive mode feedback */
- who = new userrec();
+ who = new userrec(ServerInstance);
who->fd = FD_MAGIC_NUMBER;
smode = true; /* Setting this flag tells us we should free the userrec later */
sourceserv = source; /* Set sourceserv to the actual source string */
@@ -1424,7 +1424,7 @@ class TreeSocket : public InspSocket
who = Srv->FindNick(usr);
if (who)
{
- chanrec::JoinUser(who, channel.c_str(), true, key);
+ chanrec::JoinUser(this->Instance, who, channel.c_str(), true, key);
if (modectr >= (MAXMODES-1))
{
/* theres a mode for this user. push them onto the mode queue, and flush it
@@ -1554,7 +1554,7 @@ class TreeSocket : public InspSocket
return true;
}
- userrec* _new = new userrec();
+ userrec* _new = new userrec(this->Instance);
this->Instance->clientlist[tempnick] = _new;
_new->fd = FD_MAGIC_NUMBER;
strlcpy(_new->nick, tempnick,NICKMAX-1);
@@ -2005,7 +2005,7 @@ class TreeSocket : public InspSocket
//DoOneToMany(u->nick,"NICK",par);
if (!u->ForceNickChange(params[1].c_str()))
{
- userrec::QuitUser(u, "Nickname collision");
+ userrec::QuitUser(this->Instance, u, "Nickname collision");
return true;
}
u->age = atoi(params[2].c_str());
@@ -2023,7 +2023,7 @@ class TreeSocket : public InspSocket
if (u)
{
- chanrec::JoinUser(u, params[1].c_str(), false);
+ chanrec::JoinUser(this->Instance, u, params[1].c_str(), false);
DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
}
return true;
@@ -2071,7 +2071,7 @@ class TreeSocket : public InspSocket
params[1] = ":" + params[1];
DoOneToAllButSender(prefix,"KILL",params,sourceserv);
who->Write(":%s KILL %s :%s (%s)", sourceserv.c_str(), who->nick, sourceserv.c_str(), reason.c_str());
- userrec::QuitUser(who,reason);
+ userrec::QuitUser(this->Instance,who,reason);
}
return true;
}
@@ -2958,11 +2958,11 @@ class TreeSocket : public InspSocket
p.push_back(prefix);
p.push_back("Nickname collision");
DoOneToMany(Srv->GetServerName(),"KILL",p);
- userrec::QuitUser(x,"Nickname collision ("+prefix+" -> "+params[0]+")");
+ userrec::QuitUser(this->Instance,x,"Nickname collision ("+prefix+" -> "+params[0]+")");
userrec* y = Srv->FindNick(prefix);
if (y)
{
- userrec::QuitUser(y,"Nickname collision");
+ userrec::QuitUser(this->Instance,y,"Nickname collision");
}
return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
}
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index fad2409dc..426859390 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -28,7 +28,8 @@ using namespace std;
#include "inspircd.h"
static Server *Srv;
-
+extern InspIRCd* ServerInstance;
+
class TimedBan : public classbase
{
public:
@@ -172,7 +173,7 @@ class ModuleTimedBans : public Module
// back to, so we create it a fake user that isnt in the user
// hash and set its descriptor to FD_MAGIC_NUMBER so the data
// falls into the abyss :p
- userrec* temp = new userrec;
+ userrec* temp = new userrec(ServerInstance);
temp->fd = FD_MAGIC_NUMBER;
temp->server = "";
Srv->SendMode(setban,3,temp);