summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-07-29 08:12:54 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-07-29 08:12:54 -0400
commit04200cc8382519c8ea18d214002bc0f063be7d3c (patch)
tree19537e1d5a53f3f0a5b8e965bec21ae2aa405974
parent06cb137fdea7ef68d020482ffac326c4d988945f (diff)
Made all of IRCDProto use const pointers, with the exception of SendVhostDel because of the Unreal protocol module, it makes me sad.
-rw-r--r--include/services.h94
-rw-r--r--modules/core/ns_logout.cpp1
-rw-r--r--modules/protocol/bahamut.cpp44
-rw-r--r--modules/protocol/inspircd11.cpp36
-rw-r--r--modules/protocol/inspircd12.cpp40
-rw-r--r--modules/protocol/inspircd20.cpp40
-rw-r--r--modules/protocol/ratbox.cpp36
-rw-r--r--modules/protocol/unreal32.cpp53
-rw-r--r--src/nickalias.cpp1
-rw-r--r--src/nickcore.cpp1
-rw-r--r--src/protocol.cpp50
-rw-r--r--src/users.cpp1
12 files changed, 189 insertions, 208 deletions
diff --git a/include/services.h b/include/services.h
index fdbaccbfc..73dc205ab 100644
--- a/include/services.h
+++ b/include/services.h
@@ -924,40 +924,40 @@ class ServerConfig;
class CoreExport IRCDProto
{
private:
- virtual void SendSVSKillInternal(BotInfo *, User *, const Anope::string &) = 0;
- virtual void SendModeInternal(BotInfo *, Channel *, const Anope::string &) = 0;
- virtual void SendModeInternal(BotInfo *, User *, const Anope::string &) = 0;
- virtual void SendKickInternal(BotInfo *, Channel *, User *, const Anope::string &) = 0;
- virtual void SendNoticeChanopsInternal(BotInfo *bi, Channel *, const Anope::string &) = 0;
- virtual void SendMessageInternal(BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
- virtual void SendNoticeInternal(BotInfo *bi, const Anope::string &dest, const Anope::string &msg);
- virtual void SendPrivmsgInternal(BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
- virtual void SendQuitInternal(BotInfo *bi, const Anope::string &buf);
- virtual void SendPartInternal(BotInfo *bi, Channel *chan, const Anope::string &buf);
- virtual void SendGlobopsInternal(BotInfo *source, const Anope::string &buf);
- virtual void SendCTCPInternal(BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
+ virtual void SendSVSKillInternal(const BotInfo *, const User *, const Anope::string &) = 0;
+ virtual void SendModeInternal(const BotInfo *, const Channel *, const Anope::string &) = 0;
+ virtual void SendModeInternal(const BotInfo *, const User *, const Anope::string &) = 0;
+ virtual void SendKickInternal(const BotInfo *, const Channel *, const User *, const Anope::string &) = 0;
+ virtual void SendNoticeChanopsInternal(const BotInfo *bi, const Channel *, const Anope::string &) = 0;
+ virtual void SendMessageInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
+ virtual void SendNoticeInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &msg);
+ virtual void SendPrivmsgInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
+ virtual void SendQuitInternal(const BotInfo *bi, const Anope::string &buf);
+ virtual void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf);
+ virtual void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf);
+ virtual void SendCTCPInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
virtual void SendNumericInternal(const Anope::string &source, int numeric, const Anope::string &dest, const Anope::string &buf);
public:
virtual ~IRCDProto() { }
virtual void SendSVSNOOP(const Anope::string &, int) { }
- virtual void SendTopic(BotInfo *, Channel *, const Anope::string &, const Anope::string &) = 0;
+ virtual void SendTopic(const BotInfo *, const Channel *, const Anope::string &, const Anope::string &) = 0;
virtual void SendVhostDel(User *) { }
- virtual void SendAkill(XLine *) = 0;
- virtual void SendAkillDel(XLine *) = 0;
- virtual void SendSVSKill(BotInfo *source, User *user, const char *fmt, ...);
- virtual void SendSVSMode(User *, int, const char **) = 0;
- virtual void SendMode(BotInfo *bi, Channel *dest, const char *fmt, ...);
- virtual void SendMode(BotInfo *bi, User *u, const char *fmt, ...);
+ virtual void SendAkill(const XLine *) = 0;
+ virtual void SendAkillDel(const XLine *) = 0;
+ virtual void SendSVSKill(const BotInfo *source, const User *user, const char *fmt, ...);
+ virtual void SendSVSMode(const User *, int, const char **) = 0;
+ virtual void SendMode(const BotInfo *bi, const Channel *dest, const char *fmt, ...);
+ virtual void SendMode(const BotInfo *bi, const User *u, const char *fmt, ...);
virtual void SendClientIntroduction(const Anope::string &, const Anope::string &, const Anope::string &, const Anope::string &, const Anope::string &, const Anope::string &uid) = 0;
- virtual void SendKick(BotInfo *bi, Channel *chan, User *user, const char *fmt, ...);
- virtual void SendNoticeChanops(BotInfo *bi, Channel *dest, const char *fmt, ...);
- virtual void SendMessage(BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
- virtual void SendNotice(BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
- virtual void SendAction(BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
- virtual void SendPrivmsg(BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
- virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg);
- virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg);
+ virtual void SendKick(const BotInfo *bi, const Channel *chan, const User *user, const char *fmt, ...);
+ virtual void SendNoticeChanops(const BotInfo *bi, const Channel *dest, const char *fmt, ...);
+ virtual void SendMessage(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
+ virtual void SendNotice(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
+ virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
+ virtual void SendPrivmsg(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
+ virtual void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg);
+ virtual void SendGlobalPrivmsg(const BotInfo *bi, const Server *desc, const Anope::string &msg);
/** XXX: This is a hack for NickServ enforcers. It is deprecated.
* If I catch any developer using this in new code, I will RIP YOUR BALLS OFF.
@@ -965,36 +965,36 @@ class CoreExport IRCDProto
* -- w00t
*/
virtual void SendQuit(const Anope::string &nick, const Anope::string &) MARK_DEPRECATED;
- virtual void SendQuit(BotInfo *bi, const char *fmt, ...);
+ virtual void SendQuit(const BotInfo *bi, const char *fmt, ...);
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
- virtual void SendJoin(BotInfo *bi, const Anope::string &, time_t) = 0;
- virtual void SendSQLineDel(XLine *x) = 0;
- virtual void SendInvite(BotInfo *bi, const Anope::string &chan, const Anope::string &nick);
- virtual void SendPart(BotInfo *bi, Channel *chan, const char *fmt, ...);
- virtual void SendGlobops(BotInfo *source, const char *fmt, ...);
- virtual void SendSQLine(XLine *x) = 0;
+ virtual void SendJoin(const BotInfo *bi, const Anope::string &, time_t) = 0;
+ virtual void SendSQLineDel(const XLine *x) = 0;
+ virtual void SendInvite(const BotInfo *bi, const Anope::string &chan, const Anope::string &nick);
+ virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...);
+ virtual void SendGlobops(const BotInfo *source, const char *fmt, ...);
+ virtual void SendSQLine(const XLine *x) = 0;
virtual void SendSquit(const Anope::string &servname, const Anope::string &message);
virtual void SendSVSO(const Anope::string &, const Anope::string &, const Anope::string &) { }
- virtual void SendChangeBotNick(BotInfo *bi, const Anope::string &newnick);
- virtual void SendForceNickChange(User *u, const Anope::string &newnick, time_t when);
+ virtual void SendChangeBotNick(const BotInfo *bi, const Anope::string &newnick);
+ virtual void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when);
virtual void SendVhost(User *, const Anope::string &, const Anope::string &) { }
virtual void SendConnect() = 0;
virtual void SendSVSHold(const Anope::string &) { }
virtual void SendSVSHoldDel(const Anope::string &) { }
- virtual void SendSGLineDel(XLine *) { }
- virtual void SendSZLineDel(XLine *) { }
- virtual void SendSZLine(XLine *) { }
- virtual void SendSGLine(XLine *) { }
- virtual void SendBanDel(Channel *, const Anope::string &) { }
- virtual void SendSVSModeChan(Channel *, const Anope::string &, const Anope::string &) { }
- virtual void SendUnregisteredNick(User *) { }
- virtual void SendCTCP(BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
+ virtual void SendSGLineDel(const XLine *) { }
+ virtual void SendSZLineDel(const XLine *) { }
+ virtual void SendSZLine(const XLine *) { }
+ virtual void SendSGLine(const XLine *) { }
+ virtual void SendBanDel(const Channel *, const Anope::string &) { }
+ virtual void SendSVSModeChan(const Channel *, const Anope::string &, const Anope::string &) { }
+ virtual void SendUnregisteredNick(const User *) { }
+ virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
virtual void SendSVSJoin(const Anope::string &, const Anope::string &, const Anope::string &, const Anope::string &) { }
virtual void SendSVSPart(const Anope::string &, const Anope::string &, const Anope::string &) { }
virtual void SendSWhois(const Anope::string &, const Anope::string &, const Anope::string &) { }
virtual void SendEOB() { }
- virtual void SendServer(Server *) = 0;
+ virtual void SendServer(const Server *) = 0;
virtual bool IsNickValid(const Anope::string &) { return true; }
virtual bool IsChannelValid(const Anope::string &);
virtual void SendNumeric(const Anope::string &source, int numeric, const Anope::string &dest, const char *fmt, ...);
@@ -1003,13 +1003,13 @@ class CoreExport IRCDProto
* @param u The user logging in
* @param account The account the user is logging into
*/
- virtual void SendAccountLogin(User *u, const NickCore *account) { }
+ virtual void SendAccountLogin(const User *u, const NickCore *account) { }
/** Sends a message logging a user out of an account, where ircds support such a feature.
* @param u The user logging out
* @param account The account the user is logging out of
*/
- virtual void SendAccountLogout(User *u, const NickCore *account) { }
+ virtual void SendAccountLogout(const User *u, const NickCore *account) { }
/** Set a users auto identification token
* @param u The user
diff --git a/modules/core/ns_logout.cpp b/modules/core/ns_logout.cpp
index dc744bbad..e0e8f0c7b 100644
--- a/modules/core/ns_logout.cpp
+++ b/modules/core/ns_logout.cpp
@@ -47,6 +47,7 @@ class CommandNSLogout : public Command
notice_lang(Config.s_NickServ, u, NICK_LOGOUT_SUCCEEDED);
ircdproto->SendAccountLogout(u2, u2->Account());
+ u2->RemoveMode(NickServ, UMODE_REGISTERED);
ircdproto->SendUnregisteredNick(u2);
u2->Logout();
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 9e28b1f9f..724c59879 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -87,7 +87,7 @@ void bahamut_cmd_capab()
class BahamutIRCdProto : public IRCDProto
{
- void SendModeInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -97,7 +97,7 @@ class BahamutIRCdProto : public IRCDProto
send_cmd(source->nick, "MODE %s %s", dest->name.c_str(), buf.c_str());
}
- void SendModeInternal(BotInfo *bi, User *u, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -117,13 +117,13 @@ class BahamutIRCdProto : public IRCDProto
}
/* SVSMODE -b */
- void SendBanDel(Channel *c, const Anope::string &nick)
+ void SendBanDel(const Channel *c, const Anope::string &nick)
{
SendSVSModeChan(c, "-b", nick);
}
/* SVSMODE channel modes */
- void SendSVSModeChan(Channel *c, const Anope::string &mode, const Anope::string &nick)
+ void SendSVSModeChan(const Channel *c, const Anope::string &mode, const Anope::string &nick)
{
if (!nick.empty())
send_cmd(Config.ServerName, "SVSMODE %s %s %s", c->name.c_str(), mode.c_str(), nick.c_str());
@@ -132,19 +132,19 @@ class BahamutIRCdProto : public IRCDProto
}
/* SQLINE */
- void SendSQLine(XLine *x)
+ void SendSQLine(const XLine *x)
{
send_cmd("", "SQLINE %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
/* UNSLINE */
- void SendSGLineDel(XLine *x)
+ void SendSGLineDel(const XLine *x)
{
send_cmd("", "UNSGLINE 0 :%s", x->Mask.c_str());
}
/* UNSZLINE */
- void SendSZLineDel(XLine *x)
+ void SendSZLineDel(const XLine *x)
{
/* this will likely fail so its only here for legacy */
send_cmd("", "UNSZLINE 0 %s", x->Mask.c_str());
@@ -153,7 +153,7 @@ class BahamutIRCdProto : public IRCDProto
}
/* SZLINE */
- void SendSZLine(XLine *x)
+ void SendSZLine(const XLine *x)
{
/* this will likely fail so its only here for legacy */
send_cmd("", "SZLINE %s :%s", x->Mask.c_str(), x->Reason.c_str());
@@ -168,36 +168,36 @@ class BahamutIRCdProto : public IRCDProto
}
/* SGLINE */
- void SendSGLine(XLine *x)
+ void SendSGLine(const XLine *x)
{
send_cmd("", "SGLINE %d :%s:%s", static_cast<int>(x->Mask.length()), x->Mask.c_str(), x->Reason.c_str());
}
/* RAKILL */
- void SendAkillDel(XLine *x)
+ void SendAkillDel(const XLine *x)
{
send_cmd("", "RAKILL %s %s", x->GetHost().c_str(), x->GetUser().c_str());
}
/* TOPIC */
- void SendTopic(BotInfo *whosets, Channel *c, const Anope::string &whosetit, const Anope::string &topic)
+ void SendTopic(const BotInfo *whosets, const Channel *c, const Anope::string &whosetit, const Anope::string &topic)
{
send_cmd(whosets->nick, "TOPIC %s %s %lu :%s", c->name.c_str(), whosetit.c_str(), static_cast<unsigned long>(c->topic_time), topic.c_str());
}
/* UNSQLINE */
- void SendSQLineDel(XLine *x)
+ void SendSQLineDel(const XLine *x)
{
send_cmd("", "UNSQLINE %s", x->Mask.c_str());
}
/* JOIN - SJOIN */
- void SendJoin(BotInfo *user, const Anope::string &channel, time_t chantime)
+ void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
{
send_cmd(user->nick, "SJOIN %ld %s", static_cast<long>(chantime), channel.c_str());
}
- void SendAkill(XLine *x)
+ void SendAkill(const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - time(NULL);
@@ -209,7 +209,7 @@ class BahamutIRCdProto : public IRCDProto
/*
Note: if the stamp is null 0, the below usage is correct of Bahamut
*/
- void SendSVSKillInternal(BotInfo *source, User *user, const Anope::string &buf)
+ void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
{
send_cmd(source ? source->nick : "", "SVSKILL %s :%s", user->nick.c_str(), buf.c_str());
}
@@ -221,7 +221,7 @@ class BahamutIRCdProto : public IRCDProto
* parv[3] - mode (or services id if old svs version)
* parv[4] - optional arguement (services id)
*/
- void SendSVSMode(User *u, int ac, const char **av)
+ void SendSVSMode(const User *u, int ac, const char **av)
{
this->SendModeInternal(NULL, u, merge_args(ac, av));
}
@@ -231,14 +231,14 @@ class BahamutIRCdProto : public IRCDProto
send_cmd("", "BURST 0");
}
- void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
if (buf.empty())
return;
send_cmd("", "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
}
- void SendKickInternal(BotInfo *source, Channel *chan, User *user, const Anope::string &buf)
+ void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf)
{
if (!buf.empty())
send_cmd(source->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), buf.c_str());
@@ -254,15 +254,13 @@ class BahamutIRCdProto : public IRCDProto
/* SVSMODE +d */
/* nc_change was = 1, and there is no na->status */
- void SendUnregisteredNick(User *u)
+ void SendUnregisteredNick(const User *u)
{
- BotInfo *bi = NickServ;
- u->RemoveMode(bi, UMODE_REGISTERED);
- ircdproto->SendMode(bi, u, "+d 1");
+ ircdproto->SendMode(NickServ, u, "+d 1");
}
/* SERVER */
- void SendServer(Server *server)
+ void SendServer(const Server *server)
{
send_cmd("", "SERVER %s %d :%s", server->GetName().c_str(), server->GetHops(), server->GetDescription().c_str());
}
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 3234ae81e..7f98433d7 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -93,12 +93,12 @@ void inspircd_cmd_pass(const Anope::string &pass)
class InspIRCdProto : public IRCDProto
{
- void SendAkillDel(XLine *x)
+ void SendAkillDel(const XLine *x)
{
send_cmd(Config.s_OperServ, "GLINE %s", x->Mask.c_str());
}
- void SendTopic(BotInfo *whosets, Channel *c, const Anope::string &whosetit, const Anope::string &topic)
+ void SendTopic(const BotInfo *whosets, const Channel *c, const Anope::string &whosetit, const Anope::string &topic)
{
send_cmd(whosets->nick, "FTOPIC %s %lu %s :%s", c->name.c_str(), static_cast<unsigned long>(c->topic_time), whosetit.c_str(), topic.c_str());
}
@@ -114,7 +114,7 @@ class InspIRCdProto : public IRCDProto
inspircd_cmd_chgident(u->nick, u->GetIdent());
}
- void SendAkill(XLine *x)
+ void SendAkill(const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - time(NULL);
@@ -123,12 +123,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(Config.ServerName, "ADDLINE G %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str());
}
- void SendSVSKillInternal(BotInfo *source, User *user, const Anope::string &buf)
+ void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
{
send_cmd(source ? source->nick : Config.ServerName, "KILL %s :%s", user->nick.c_str(), buf.c_str());
}
- void SendSVSMode(User *u, int ac, const char **av)
+ void SendSVSMode(const User *u, int ac, const char **av)
{
this->SendModeInternal(NULL, u, merge_args(ac, av));
}
@@ -138,14 +138,14 @@ class InspIRCdProto : public IRCDProto
send_cmd(source, "PUSH %s ::%s %03d %s %s", dest.c_str(), source.c_str(), numeric, dest.c_str(), buf.c_str());
}
- void SendModeInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
if (buf.empty())
return;
send_cmd(source ? source->nick : Config.s_OperServ, "FMODE %s %u %s", dest->name.c_str(), static_cast<unsigned>(dest->creation_time), buf.c_str());
}
- void SendModeInternal(BotInfo *bi, User *u, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -158,7 +158,7 @@ class InspIRCdProto : public IRCDProto
send_cmd(nick, "OPERTYPE Service");
}
- void SendKickInternal(BotInfo *source, Channel *chan, User *user, const Anope::string &buf)
+ void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf)
{
if (!buf.empty())
send_cmd(source->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), buf.c_str());
@@ -166,7 +166,7 @@ class InspIRCdProto : public IRCDProto
send_cmd(source->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), user->nick.c_str());
}
- void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -174,25 +174,25 @@ class InspIRCdProto : public IRCDProto
}
/* SERVER services-dev.chatspike.net password 0 :Description here */
- void SendServer(Server *server)
+ void SendServer(const Server *server)
{
send_cmd(Config.ServerName, "SERVER %s %s %d :%s", server->GetName().c_str(), currentpass.c_str(), server->GetHops(), server->GetDescription().c_str());
}
/* JOIN */
- void SendJoin(BotInfo *user, const Anope::string &channel, time_t chantime)
+ void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
{
send_cmd(user->nick, "JOIN %s %ld", channel.c_str(), static_cast<long>(chantime));
}
/* UNSQLINE */
- void SendSQLineDel(XLine *x)
+ void SendSQLineDel(const XLine *x)
{
send_cmd(Config.s_OperServ, "QLINE %s", x->Mask.c_str());
}
/* SQLINE */
- void SendSQLine(XLine *x)
+ void SendSQLine(const XLine *x)
{
send_cmd(Config.ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config.s_OperServ.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
@@ -249,23 +249,17 @@ class InspIRCdProto : public IRCDProto
}
/* UNSZLINE */
- void SendSZLineDel(XLine *x)
+ void SendSZLineDel(const XLine *x)
{
send_cmd(Config.s_OperServ, "ZLINE %s", x->Mask.c_str());
}
/* SZLINE */
- void SendSZLine(XLine *x)
+ void SendSZLine(const XLine *x)
{
send_cmd(Config.ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
- /* SVSMODE +- */
- void SendUnregisteredNick(User *u)
- {
- u->RemoveMode(NickServ, UMODE_REGISTERED);
- }
-
void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &)
{
send_cmd(source, "SVSJOIN %s %s", nick.c_str(), chan.c_str());
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index f8d0c1563..97cfbac29 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -98,12 +98,12 @@ void inspircd_cmd_pass(const Anope::string &pass)
class InspIRCdProto : public IRCDProto
{
- void SendAkillDel(XLine *x)
+ void SendAkillDel(const XLine *x)
{
send_cmd(OperServ->GetUID(), "GLINE %s", x->Mask.c_str());
}
- void SendTopic(BotInfo *whosets, Channel *c, const Anope::string &whosetit, const Anope::string &topic)
+ void SendTopic(const BotInfo *whosets, const Channel *c, const Anope::string &whosetit, const Anope::string &topic)
{
send_cmd(whosets->GetUID(), "FTOPIC %s %lu %s :%s", c->name.c_str(), static_cast<unsigned long>(c->topic_time), whosetit.c_str(), topic.c_str());
}
@@ -119,7 +119,7 @@ class InspIRCdProto : public IRCDProto
inspircd_cmd_chgident(u->nick, u->GetIdent());
}
- void SendAkill(XLine *x)
+ void SendAkill(const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - time(NULL);
@@ -128,12 +128,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(OperServ->GetUID(), "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str());
}
- void SendSVSKillInternal(BotInfo *source, User *user, const Anope::string &buf)
+ void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
{
send_cmd(source ? source->GetUID() : TS6SID, "KILL %s :%s", user->GetUID().c_str(), buf.c_str());
}
- void SendSVSMode(User *u, int ac, const char **av)
+ void SendSVSMode(const User *u, int ac, const char **av)
{
this->SendModeInternal(NULL, u, merge_args(ac, av));
}
@@ -143,12 +143,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "PUSH %s ::%s %03d %s %s", dest.c_str(), source.c_str(), numeric, dest.c_str(), buf.c_str());
}
- void SendModeInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(source ? source->GetUID() : TS6SID, "FMODE %s %u %s", dest->name.c_str(), static_cast<unsigned>(dest->creation_time), buf.c_str());
}
- void SendModeInternal(BotInfo *bi, User *u, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -160,7 +160,7 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", uid.c_str(), static_cast<long>(time(NULL)), nick.c_str(), host.c_str(), host.c_str(), user.c_str(), static_cast<long>(time(NULL)), modes.c_str(), real.c_str());
}
- void SendKickInternal(BotInfo *source, Channel *chan, User *user, const Anope::string &buf)
+ void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf)
{
if (!buf.empty())
send_cmd(source->GetUID(), "KICK %s %s :%s", chan->name.c_str(), user->GetUID().c_str(), buf.c_str());
@@ -168,31 +168,31 @@ class InspIRCdProto : public IRCDProto
send_cmd(source->GetUID(), "KICK %s %s :%s", chan->name.c_str(), user->GetUID().c_str(), user->nick.c_str());
}
- void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(TS6SID, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
}
/* SERVER services-dev.chatspike.net password 0 :Description here */
- void SendServer(Server *server)
+ void SendServer(const Server *server)
{
send_cmd("", "SERVER %s %s %d %s :%s", server->GetName().c_str(), currentpass.c_str(), server->GetHops(), server->GetSID().c_str(), server->GetDescription().c_str());
}
/* JOIN */
- void SendJoin(BotInfo *user, const Anope::string &channel, time_t chantime)
+ void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
{
send_cmd(TS6SID, "FJOIN %s %ld + :,%s", channel.c_str(), static_cast<long>(chantime), user->GetUID().c_str());
}
/* UNSQLINE */
- void SendSQLineDel(XLine *x)
+ void SendSQLineDel(const XLine *x)
{
send_cmd(TS6SID, "DELLINE Q %s", x->Mask.c_str());
}
/* SQLINE */
- void SendSQLine(XLine *x)
+ void SendSQLine(const XLine *x)
{
send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config.s_OperServ.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
@@ -243,23 +243,17 @@ class InspIRCdProto : public IRCDProto
}
/* UNSZLINE */
- void SendSZLineDel(XLine *x)
+ void SendSZLineDel(const XLine *x)
{
send_cmd(TS6SID, "DELLINE Z %s", x->Mask.c_str());
}
/* SZLINE */
- void SendSZLine(XLine *x)
+ void SendSZLine(const XLine *x)
{
send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
- /* SVSMODE -r */
- void SendUnregisteredNick(User *u)
- {
- u->RemoveMode(NickServ, UMODE_REGISTERED);
- }
-
void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &)
{
User *u = finduser(nick);
@@ -294,12 +288,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(source ? source->GetUID() : TS6SID, "SNONOTICE A :%s", buf.c_str());
}
- void SendAccountLogin(User *u, const NickCore *account)
+ void SendAccountLogin(const User *u, const NickCore *account)
{
send_cmd(TS6SID, "METADATA %s accountname :%s", u->GetUID().c_str(), account->display.c_str());
}
- void SendAccountLogout(User *u, const NickCore *account)
+ void SendAccountLogout(const User *u, const NickCore *account)
{
send_cmd(TS6SID, "METADATA %s accountname :", u->GetUID().c_str());
}
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 043e3d256..6ca1727c6 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -96,12 +96,12 @@ void inspircd_cmd_pass(const Anope::string &pass)
class InspIRCdProto : public IRCDProto
{
- void SendAkillDel(XLine *x)
+ void SendAkillDel(const XLine *x)
{
send_cmd(OperServ->GetUID(), "GLINE %s", x->Mask.c_str());
}
- void SendTopic(BotInfo *whosets, Channel *c, const Anope::string &whosetit, const Anope::string &topic)
+ void SendTopic(const BotInfo *whosets, const Channel *c, const Anope::string &whosetit, const Anope::string &topic)
{
send_cmd(whosets->GetUID(), "FTOPIC %s %lu %s :%s", c->name.c_str(), static_cast<unsigned long>(c->topic_time), whosetit.c_str(), topic.c_str());
}
@@ -117,7 +117,7 @@ class InspIRCdProto : public IRCDProto
inspircd_cmd_chgident(u->nick, u->GetIdent());
}
- void SendAkill(XLine *x)
+ void SendAkill(const XLine *x)
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - time(NULL);
@@ -126,12 +126,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(OperServ->GetUID(), "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str());
}
- void SendSVSKillInternal(BotInfo *source, User *user, const Anope::string &buf)
+ void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
{
send_cmd(source ? source->GetUID() : TS6SID, "KILL %s :%s", user->GetUID().c_str(), buf.c_str());
}
- void SendSVSMode(User *u, int ac, const char **av)
+ void SendSVSMode(const User *u, int ac, const char **av)
{
this->SendModeInternal(NULL, u, merge_args(ac, av));
}
@@ -141,12 +141,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "PUSH %s ::%s %03d %s %s", dest.c_str(), source.c_str(), numeric, dest.c_str(), buf.c_str());
}
- void SendModeInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(source ? source->GetUID() : TS6SID, "FMODE %s %u %s", dest->name.c_str(), static_cast<unsigned>(dest->creation_time), buf.c_str());
}
- void SendModeInternal(BotInfo *bi, User *u, const Anope::string &buf)
+ void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
{
if (buf.empty())
return;
@@ -158,7 +158,7 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", uid.c_str(), static_cast<long>(time(NULL)), nick.c_str(), host.c_str(), host.c_str(), user.c_str(), static_cast<long>(time(NULL)), modes.c_str(), real.c_str());
}
- void SendKickInternal(BotInfo *source, Channel *chan, User *user, const Anope::string &buf)
+ void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf)
{
if (!buf.empty())
send_cmd(source->GetUID(), "KICK %s %s :%s", chan->name.c_str(), user->GetUID().c_str(), buf.c_str());
@@ -166,31 +166,31 @@ class InspIRCdProto : public IRCDProto
send_cmd(source->GetUID(), "KICK %s %s :%s", chan->name.c_str(), user->GetUID().c_str(), user->nick.c_str());
}
- void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const Anope::string &buf)
+ void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
{
send_cmd(TS6SID, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
}
/* SERVER services-dev.chatspike.net password 0 :Description here */
- void SendServer(Server *server)
+ void SendServer(const Server *server)
{
send_cmd("", "SERVER %s %s %d %s :%s", server->GetName().c_str(), currentpass.c_str(), server->GetHops(), server->GetSID().c_str(), server->GetDescription().c_str());
}
/* JOIN */
- void SendJoin(BotInfo *user, const Anope::string &channel, time_t chantime)
+ void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
{
send_cmd(TS6SID, "FJOIN %s %ld + :,%s", channel.c_str(), static_cast<long>(chantime), user->GetUID().c_str());
}
/* UNSQLINE */
- void SendSQLineDel(XLine *x)
+ void SendSQLineDel(const XLine *x)
{
send_cmd(TS6SID, "DELLINE Q %s", x->Mask.c_str());
}
/* SQLINE */
- void SendSQLine(XLine *x)
+ void SendSQLine(const XLine *x)
{
send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config.s_OperServ.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
@@ -244,23 +244,17 @@ class InspIRCdProto : public IRCDProto
}
/* UNSZLINE */
- void SendSZLineDel(XLine *x)
+ void SendSZLineDel(const XLine *x)
{
send_cmd(TS6SID, "DELLINE Z %s", x->Mask.c_str());
}
/* SZLINE */
- void SendSZLine(XLine *x)
+ void SendSZLine(const XLine *x)
{
send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str());
}
- /* SVSMODE -r */
- void SendUnregisteredNick(User *u)
- {
- u->RemoveMode(NickServ, UMODE_REGISTERED);
- }
-
void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &)
{
User *u = finduser(nick);
@@ -292,12 +286,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(source ? source->GetUID() : TS6SID, "SNONOTICE g :%s", buf.c_str());
}
- void SendAccountLogin(User *u, const NickCore *account)
+ void SendAccountLogin(const User *u, const NickCore *account)
{
send_cmd(TS6SID, "METADATA %s accountname :%s", u->GetUID().c_str(), account->display.c_str());
}
- void SendAccountLogout(User *u, const NickCore *account)
+ void SendAccountLogout(const User *u, const NickCore *account)
{
send_cmd(TS6SID, "METADATA %s accountname :", u->GetUID().c_str());
}
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index df241e3fc..623d5a31e 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -112,57 +112,57 @@ class RatboxProto : public IRCDTS6Proto
send_cmd(TS6SID, "OPERWALL :%s", buf.c_str());
}
- void SendSQLine(XLine *x)
+ void SendSQLine(const XLine *x)
{
send_cmd(TS6SID, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str());
}
- void SendSGLineDel(XLine *x)
+ void SendSGLineDel(const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config.s_OperServ, "UNXLINE * %s", x->Mask.c_str());
}
- void SendSGLine(XLine *x)
+ void SendSGLine(const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config.s_OperServ, "XLINE * %s 0 :%s", x->Mask.c_str(), x->Reason.c_str());
}
- void SendAkillDel(XLine *x)
+ void SendAkillDel(const XLine *x)
{
BotInfo *bi = OperServ;
send_cmd(bi ? bi->GetUID() : Config.s_OperServ, "UNKLINE * %s %s", x->GetUser().c_str(), x->GetHost().c_str());
}
- void SendSQLineDel(XLine *x)
+ void SendSQLineDel(const XLine *x)
{
send_cmd(TS6SID, "UNRESV * %s", x->Mask.c_str());
}
- void SendJoin(BotInfo *user, const Anope::string &channel, time_t chantime)
+ void SendJoin(const BotInfo *user, const Anope::string &channel, time_t chantime)
{
send_cmd("", "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel.c_str(), user->GetUID().c_str());
}
- void SendAkill(XLine *x)
+ void SendAkill(const XLine *x)