summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions.c7
-rw-r--r--src/bots.cpp4
-rw-r--r--src/botserv.c14
-rw-r--r--src/channels.c16
-rw-r--r--src/chanserv.c16
-rw-r--r--src/core/cs_ban.c5
-rw-r--r--src/core/cs_clear.c8
-rw-r--r--src/core/cs_drop.c2
-rw-r--r--src/core/cs_forbid.c4
-rw-r--r--src/core/cs_kick.c4
-rw-r--r--src/core/cs_set.c2
-rw-r--r--src/core/cs_suspend.c6
-rw-r--r--src/core/cs_topic.c4
-rw-r--r--src/core/hs_on.c2
-rw-r--r--src/core/ns_drop.c4
-rw-r--r--src/core/ns_forbid.c2
-rw-r--r--src/core/ns_getpass.c4
-rw-r--r--src/core/ns_saset.c2
-rw-r--r--src/core/ns_suspend.c4
-rw-r--r--src/core/os_akill.c2
-rw-r--r--src/core/os_chankill.c2
-rw-r--r--src/core/os_clearmodes.c12
-rw-r--r--src/core/os_defcon.c6
-rw-r--r--src/core/os_global.c2
-rw-r--r--src/core/os_jupe.c2
-rw-r--r--src/core/os_kick.c13
-rw-r--r--src/core/os_mode.c2
-rw-r--r--src/core/os_noop.c2
-rw-r--r--src/core/os_oline.c4
-rw-r--r--src/core/os_set.c6
-rw-r--r--src/core/os_sgline.c2
-rw-r--r--src/core/os_sqline.c2
-rw-r--r--src/core/os_svsnick.c7
-rw-r--r--src/core/os_szline.c2
-rw-r--r--src/core/os_umode.c2
-rw-r--r--src/datafiles.c3
-rw-r--r--src/hostserv.c14
-rw-r--r--src/messages.c2
-rw-r--r--src/modulemanager.cpp4
-rw-r--r--src/modules/cs_appendtopic.c4
-rw-r--r--src/modules/cs_enforce.c4
-rw-r--r--src/modules/os_info.c2
-rw-r--r--src/nickserv.c8
-rw-r--r--src/operserv.c36
-rw-r--r--src/protocol.cpp41
-rw-r--r--src/protocol/bahamut.c73
-rw-r--r--src/protocol/inspircd11.c66
-rw-r--r--src/protocol/inspircd12.cpp73
-rw-r--r--src/protocol/ratbox.c60
-rw-r--r--src/protocol/unreal32.c70
-rw-r--r--src/regchannel.cpp2
-rw-r--r--src/send.c4
-rw-r--r--src/servers.c2
-rw-r--r--src/sessions.c6
-rw-r--r--src/users.c2
55 files changed, 306 insertions, 348 deletions
diff --git a/src/actions.c b/src/actions.c
index 37bf95798..76ddb435b 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -65,7 +65,7 @@ void kill_user(const char *source, const char *user, const char *reason)
snprintf(buf, sizeof(buf), "%s (%s)", source, reason);
- ircdproto->SendSVSKill(source, user, buf);
+ ircdproto->SendSVSKill(findbot(source), finduser(user), buf);
if (!ircd->quitonkill && finduser(user)) {
do_kill(user, buf);
@@ -106,8 +106,7 @@ void sqline(char *mask, char *reason)
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason;
- ircdproto->SendKick(findbot(Config.s_OperServ), av[0], av[1],
- "Q-Lined: %s", av[2]);
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, cu->user, "Q-Lined: %s", av[2]);
do_kick(Config.s_ChanServ, 3, av);
}
}
@@ -161,7 +160,7 @@ void common_unban(ChannelInfo * ci, char *nick)
ip = str_is_ip(host);
if (ircd->svsmode_unban)
- ircdproto->SendBanDel(ci->name, nick);
+ ircdproto->SendBanDel(ci->c, nick);
else
{
for (ban = ci->c->bans->entries; ban; ban = next)
diff --git a/src/bots.cpp b/src/bots.cpp
index ff439e6d4..cae202bf2 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -167,9 +167,9 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci)
if (ci->c && ci->c->usercount >= Config.BSMinUsers)
{
if (u)
- ircdproto->SendPart(ci->bi, ci->name, "UNASSIGN from %s", u->nick);
+ ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick);
else
- ircdproto->SendPart(ci->bi, ci->name, "");
+ ircdproto->SendPart(ci->bi, ci->c, "");
}
ci->bi->chancount--;
diff --git a/src/botserv.c b/src/botserv.c
index 9a8229d6c..9dc7e3ed1 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -644,7 +644,7 @@ void bot_join(ChannelInfo * ci)
/* Should we be invited? */
if (ci->c->HasMode(CMODE_INVITE)
|| (limit && ci->c->usercount >= limit))
- ircdproto->SendNoticeChanops(ci->bi, ci->c->name,
+ ircdproto->SendNoticeChanops(ci->bi, ci->c,
"%s invited %s into the channel.",
ci->bi->nick, ci->bi->nick);
}
@@ -708,7 +708,7 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
av[0] = ci->name;
av[1] = u->nick;
av[2] = buf;
- ircdproto->SendKick(ci->bi, av[0], av[1], "%s", av[2]);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, buf));
}
@@ -765,10 +765,9 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
/* Check if we need to do a signkick or not -GD */
if ((ci->HasFlag(CI_SIGNKICK) || ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK))
- ircdproto->SendKick(ci->bi, kav[0], kav[1], "%s (%s)", kav[2],
- requester->nick);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", kav[2], requester->nick);
else
- ircdproto->SendKick(ci->bi, kav[0], kav[1], "%s", kav[2]);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s", kav[2]);
do_kick(ci->bi->nick, 3, kav);
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, kav[2]));
@@ -811,10 +810,9 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
}
if (ci->HasFlag(CI_SIGNKICK) || ((ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK)))
- ircdproto->SendKick(ci->bi, av[0], av[1], "%s (%s)", av[2],
- requester->nick);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", av[2], requester->nick);
else
- ircdproto->SendKick(ci->bi, av[0], av[1], "%s", av[2]);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, av[2]));
}
diff --git a/src/channels.c b/src/channels.c
index 2115d2658..997432d88 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -319,7 +319,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string &param, bool
{
ci->UnsetFlag(CI_PERSIST);
if (Config.s_BotServ && ci->bi && usercount == Config.BSMinUsers - 1)
- ircdproto->SendPart(ci->bi, name, NULL);
+ ircdproto->SendPart(ci->bi, this, NULL);
if (!users)
delete this;
}
@@ -735,7 +735,7 @@ void chan_deluser(User * user, Channel * c)
return;
if (Config.s_BotServ && c->ci && c->ci->bi && c->usercount == Config.BSMinUsers - 1)
- ircdproto->SendPart(c->ci->bi, c->name, NULL);
+ ircdproto->SendPart(c->ci->bi, c, NULL);
if (!c->users)
delete c;
@@ -1318,7 +1318,7 @@ void do_sjoin(const char *source, int ac, const char **av)
if (c->ci->bi)
{
/* This is ugly, but it always works */
- ircdproto->SendPart(c->ci->bi, c->name, "TS reop");
+ ircdproto->SendPart(c->ci->bi, c, "TS reop");
bot_join(c->ci);
}
/* Make sure +r is set */
@@ -1425,7 +1425,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
- ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined");
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, user, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
@@ -1511,7 +1511,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
- ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined");
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, user, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
@@ -1586,7 +1586,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
- ircdproto->SendKick(findbot(Config.s_OperServ), av[1], s, "Q-Lined");
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, user, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
@@ -1644,7 +1644,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
- ircdproto->SendKick(findbot(Config.s_OperServ), av[1], user->nick, "Q-Lined");
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, user, "Q-Lined");
} else {
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
@@ -2047,7 +2047,7 @@ Channel *join_user_update(User * user, Channel * chan, const char *name,
if (chan->ci->bi)
{
/* This is ugly, but it always works */
- ircdproto->SendPart(chan->ci->bi, chan->name, "TS reop");
+ ircdproto->SendPart(chan->ci->bi, chan, "TS reop");
bot_join(chan->ci);
}
/* Make sure +r is set */
diff --git a/src/chanserv.c b/src/chanserv.c
index c85efc259..941925b1b 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -136,7 +136,8 @@ class ChanServTimer : public Timer
if (ci)
ci->UnsetFlag(CI_INHABIT);
- ircdproto->SendPart(findbot(Config.s_ChanServ), channel.c_str(), NULL);
+ if (ci->c)
+ ircdproto->SendPart(findbot(Config.s_ChanServ), ci->c, NULL);
}
};
@@ -722,7 +723,8 @@ int check_kick(User * user, const char *chan, time_t chants)
}
c->SetMode(NULL, CMODE_BAN, mask);
- ircdproto->SendKick(whosends(ci), chan, user->nick, "%s", reason);
+ if (c)
+ ircdproto->SendKick(whosends(ci), c, user, "%s", reason);
return 1;
}
@@ -793,11 +795,10 @@ void restore_topic(const char *chan)
c->SetMode(NULL, CMODE_OP, Config.s_ChanServ);
}
}
- ircdproto->SendTopic(whosends(ci), c->name, c->topic_setter,
- c->topic ? c->topic : "", c->topic_time);
+ ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic ? c->topic : "");
if (ircd->join2set) {
if (whosends(ci) == findbot(Config.s_ChanServ)) {
- ircdproto->SendPart(findbot(Config.s_ChanServ), c->name, NULL);
+ ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL);
}
}
}
@@ -856,12 +857,11 @@ int check_topiclock(Channel * c, time_t topic_time)
}
}
- ircdproto->SendTopic(whosends(ci), c->name, c->topic_setter,
- c->topic ? c->topic : "", c->topic_time);
+ ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic ? c->topic : "");
if (ircd->join2set) {
if (whosends(ci) == findbot(Config.s_ChanServ)) {
- ircdproto->SendPart(findbot(Config.s_ChanServ), c->ci->name, NULL);
+ ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL);
}
}
return 1;
diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c
index 81a1c5124..f6fb4f092 100644
--- a/src/core/cs_ban.c
+++ b/src/core/cs_ban.c
@@ -78,10 +78,9 @@ class CommandCSBan : public Command
if ((ci->HasFlag(CI_SIGNKICK))
|| ((ci->HasFlag(CI_SIGNKICK_LEVEL))
&& !check_access(u, ci, CA_SIGNKICK)))
- ircdproto->SendKick(whosends(ci), ci->name, target, "%s (%s)",
- reason, u->nick);
+ ircdproto->SendKick(whosends(ci), ci->c, u2, "%s (%s)", reason, u->nick);
else
- ircdproto->SendKick(whosends(ci), ci->name, target, "%s", reason);
+ ircdproto->SendKick(whosends(ci), ci->c, u2, "%s", reason);
const char *kav[4];
kav[0] = ci->name;
diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c
index fa82c9f11..cc8208829 100644
--- a/src/core/cs_clear.c
+++ b/src/core/cs_clear.c
@@ -68,18 +68,18 @@ class CommandCSClear : public Command
if (ircd->svsmode_ucmode) {
av[0] = chan;
- ircdproto->SendSVSModeChan(av[0], "-o", NULL);
+ ircdproto->SendSVSModeChan(c, "-o", NULL);
if (owner) {
modebuf = '-';
modebuf += owner->ModeChar;
- ircdproto->SendSVSModeChan(av[0], modebuf.c_str(), NULL);
+ ircdproto->SendSVSModeChan(c, modebuf.c_str(), NULL);
}
if (admin) {
modebuf = '-';
modebuf += admin->ModeChar;
- ircdproto->SendSVSModeChan(av[0], modebuf.c_str(), NULL);
+ ircdproto->SendSVSModeChan(c, modebuf.c_str(), NULL);
}
for (cu = c->users; cu; cu = bnext)
{
@@ -159,7 +159,7 @@ class CommandCSClear : public Command
av[0] = sstrdup(chan);
av[1] = sstrdup(cu->user->nick);
av[2] = sstrdup(buf);
- ircdproto->SendKick(whosends(ci), av[0], av[1], av[2]);
+ ircdproto->SendKick(whosends(ci), c, cu->user, av[2]);
do_kick(Config.s_ChanServ, 3, av);
delete [] av[2];
delete [] av[1];
diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c
index 561f79e6f..82ffc2a1f 100644
--- a/src/core/cs_drop.c
+++ b/src/core/cs_drop.c
@@ -81,7 +81,7 @@ class CommandCSDrop : public Command
*/
if (Config.WallDrop) {
if ((level < ACCESS_FOUNDER) || (!IsRealFounder(u, ci) && ci->HasFlag(CI_SECUREFOUNDER)))
- ircdproto->SendGlobops(Config.s_ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick, chan);
+ ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used DROP on channel \2%s\2", u->nick, chan);
}
notice_lang(Config.s_ChanServ, u, CHAN_DROPPED, chan);
diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c
index 61b045cd9..9c1690fe2 100644
--- a/src/core/cs_forbid.c
+++ b/src/core/cs_forbid.c
@@ -85,13 +85,13 @@ class CommandCSForbid : public Command
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason ? reason : getstring(cu->user->nc, CHAN_FORBID_REASON);
- ircdproto->SendKick(findbot(Config.s_ChanServ), av[0], av[1], av[2]);
+ ircdproto->SendKick(findbot(Config.s_ChanServ), c, cu->user, av[2]);
do_kick(Config.s_ChanServ, 3, av);
}
}
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick, ci->name);
+ ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used FORBID on channel \2%s\2", u->nick, ci->name);
if (ircd->chansqline)
{
diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c
index 5239d53cb..93d42620a 100644
--- a/src/core/cs_kick.c
+++ b/src/core/cs_kick.c
@@ -68,10 +68,10 @@ class CommandCSKick : public Command
if ((ci->HasFlag(CI_SIGNKICK))
|| ((ci->HasFlag(CI_SIGNKICK_LEVEL))
&& !check_access(u, ci, CA_SIGNKICK)))
- ircdproto->SendKick(whosends(ci), ci->name, target, "%s (%s)",
+ ircdproto->SendKick(whosends(ci), ci->c, u2, "%s (%s)",
reason, u->nick);
else
- ircdproto->SendKick(whosends(ci), ci->name, target, "%s", reason);
+ ircdproto->SendKick(whosends(ci), ci->c, u2, "%s", reason);
av[0] = ci->name;
av[1] = target;
av[2] = reason;
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 40cdd287d..1ac511e17 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -589,7 +589,7 @@ class CommandCSSet : public Command
else if (ci->c)
{
if (Config.s_BotServ && ci->bi && ci->c->usercount == Config.BSMinUsers - 1)
- ircdproto->SendPart(ci->bi, ci->c->name, NULL);
+ ircdproto->SendPart(ci->bi, ci->c, NULL);
if (!ci->c->users)
delete ci->c;
diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c
index ddad30930..8976ba745 100644
--- a/src/core/cs_suspend.c
+++ b/src/core/cs_suspend.c
@@ -75,13 +75,13 @@ class CommandCSSuspend : public Command
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason ? reason : getstring(cu->user->nc, CHAN_SUSPEND_REASON);
- ircdproto->SendKick(findbot(Config.s_ChanServ), av[0], av[1], av[2]);
+ ircdproto->SendKick(findbot(Config.s_ChanServ), c, cu->user, av[2]);
do_kick(Config.s_ChanServ, 3, av);
}
}
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick, ci->name);
+ ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used SUSPEND on channel \2%s\2", u->nick, ci->name);
alog("%s: %s set SUSPEND for channel %s", Config.s_ChanServ, u->nick, ci->name);
notice_lang(Config.s_ChanServ, u, CHAN_SUSPEND_SUCCEEDED, chan);
@@ -151,7 +151,7 @@ class CommandCSUnSuspend : public Command
}
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick, ci->name);
+ ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick, ci->name);
alog("%s: %s set UNSUSPEND for channel %s", Config.s_ChanServ, u->nick, ci->name);
notice_lang(Config.s_ChanServ, u, CHAN_UNSUSPEND_SUCCEEDED, chan);
diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c
index d570fa827..2187a61e1 100644
--- a/src/core/cs_topic.c
+++ b/src/core/cs_topic.c
@@ -61,9 +61,9 @@ class CommandCSTopic : public Command
ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name, c->creation_time);
ircdproto->SendMode(NULL, c->name, "+o %s", Config.s_ChanServ);
}
- ircdproto->SendTopic(whosends(ci), c->name, u->nick, topic ? topic : "", c->topic_time);
+ ircdproto->SendTopic(whosends(ci), c, u->nick, topic ? topic : "");
if (ircd->join2set && whosends(ci) == findbot(Config.s_ChanServ))
- ircdproto->SendPart(findbot(Config.s_ChanServ), c->name, NULL);
+ ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL);
}
return MOD_CONT;
}
diff --git a/src/core/hs_on.c b/src/core/hs_on.c
index 985ce3e13..aaddbf28d 100644
--- a/src/core/hs_on.c
+++ b/src/core/hs_on.c
@@ -37,7 +37,7 @@ class CommandHSOn : public Command
notice_lang(Config.s_HostServ, u, HOST_IDENT_ACTIVATED, vIdent, vHost);
else
notice_lang(Config.s_HostServ, u, HOST_ACTIVATED, vHost);
- ircdproto->SendVhost(u->nick, vIdent, vHost);
+ ircdproto->SendVhost(u, vIdent, vHost);
if (ircd->vhost)
{
if (u->vhost)
diff --git a/src/core/ns_drop.c b/src/core/ns_drop.c
index 096fb09af..064390cbd 100644
--- a/src/core/ns_drop.c
+++ b/src/core/ns_drop.c
@@ -43,7 +43,7 @@ class CommandNSDrop : public Command
if ((nr = findrequestnick(nick)) && u->nc->IsServicesOper())
{
if (Config.WallDrop)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used DROP on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used DROP on \2%s\2", u->nick, nick);
alog("%s: %s!%s@%s dropped nickname %s (e-mail: %s)", Config.s_NickServ, u->nick, u->GetIdent().c_str(), u->host, nr->nick, nr->email);
delete nr;
notice_lang(Config.s_NickServ, u, NICK_X_DROPPED, nick);
@@ -80,7 +80,7 @@ class CommandNSDrop : public Command
if (!is_mine)
{
if (Config.WallDrop)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used DROP on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used DROP on \2%s\2", u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_X_DROPPED, nick);
}
else
diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c
index 68deea161..f45dadceb 100644
--- a/src/core/ns_forbid.c
+++ b/src/core/ns_forbid.c
@@ -71,7 +71,7 @@ class CommandNSForbid : public Command
ircdproto->SendSQLine(na->nick, reason ? reason : "Forbidden");
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used FORBID on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used FORBID on \2%s\2", u->nick, nick);
alog("%s: %s set FORBID for nick %s", Config.s_NickServ, u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_FORBID_SUCCEEDED, nick);
diff --git a/src/core/ns_getpass.c b/src/core/ns_getpass.c
index ac52ccac9..8f4600814 100644
--- a/src/core/ns_getpass.c
+++ b/src/core/ns_getpass.c
@@ -35,7 +35,7 @@ class CommandNSGetPass : public Command
{
alog("%s: %s!%s@%s used GETPASS on %s", Config.s_NickServ, u->nick, u->GetIdent().c_str(), u->host, nick);
if (Config.WallGetpass)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used GETPASS on \2%s\2", u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_GETPASS_PASSCODE_IS, nick, nr->passcode);
}
else
@@ -51,7 +51,7 @@ class CommandNSGetPass : public Command
{
alog("%s: %s!%s@%s used GETPASS on %s", Config.s_NickServ, u->nick, u->GetIdent().c_str(), u->host, nick);
if (Config.WallGetpass)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used GETPASS on \2%s\2", u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick, tmp_pass);
}
else
diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c
index 54f0608b0..28ba915bd 100644
--- a/src/core/ns_saset.c
+++ b/src/core/ns_saset.c
@@ -95,7 +95,7 @@ private:
alog("%s: %s!%s@%s used SASET PASSWORD on %s (e-mail: %s)", Config.s_NickServ, u->nick, u->GetIdent().c_str(), u->host, nc->display, nc->email ? nc->email : "none");
if (Config.WallSetpass)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used SASET PASSWORD on \2%s\2", u->nick, nc->display);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used SASET PASSWORD on \2%s\2", u->nick, nc->display);
return MOD_CONT;
}
diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c
index c7a1690ae..330e96222 100644
--- a/src/core/ns_suspend.c
+++ b/src/core/ns_suspend.c
@@ -79,7 +79,7 @@ class CommandNSSuspend : public Command
}
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used SUSPEND on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used SUSPEND on \2%s\2", u->nick, nick);
alog("%s: %s set SUSPEND for nick %s", Config.s_NickServ, u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_SUSPEND_SUCCEEDED, nick);
@@ -147,7 +147,7 @@ class CommandNSUnSuspend : public Command
na->nc->UnsetFlag(NI_SUSPENDED);
if (Config.WallForbid)
- ircdproto->SendGlobops(Config.s_NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_NickServ), "\2%s\2 used UNSUSPEND on \2%s\2", u->nick, nick);
alog("%s: %s set UNSUSPEND for nick %s", Config.s_NickServ, u->nick, nick);
notice_lang(Config.s_NickServ, u, NICK_UNSUSPEND_SUCCEEDED, nick);
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index ae36ad5da..7561cb0e6 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -129,7 +129,7 @@ class CommandOSAKill : public Command
snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s");
}
- ircdproto->SendGlobops(Config.s_OperServ, "%s added an AKILL for %s (%s) (%s)", u->nick, mask, realreason, buf);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s added an AKILL for %s (%s) (%s)", u->nick, mask, realreason, buf);
}
if (readonly)
diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c
index acd734deb..d4003412f 100644
--- a/src/core/os_chankill.c
+++ b/src/core/os_chankill.c
@@ -80,7 +80,7 @@ class CommandOSChanKill : public Command
check_akill(cu->user->nick, cu->user->GetIdent().c_str(), cu->user->host, NULL, NULL);
}
if (Config.WallOSAkill)
- ircdproto->SendGlobops(Config.s_OperServ, "%s used CHANKILL on %s (%s)", u->nick, channel, realreason);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s used CHANKILL on %s (%s)", u->nick, channel, realreason);
}
else
notice_lang(Config.s_OperServ, u, CHAN_X_NOT_IN_USE, channel);
diff --git a/src/core/os_clearmodes.c b/src/core/os_clearmodes.c
index d2e136983..d35faa3ae 100644
--- a/src/core/os_clearmodes.c
+++ b/src/core/os_clearmodes.c
@@ -54,12 +54,12 @@ class CommandOSClearModes : public Command
}
if (Config.WallOSClearmodes)
- ircdproto->SendGlobops(Config.s_OperServ, "%s used CLEARMODES%s on %s", u->nick, all ? " ALL" : "", chan);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s used CLEARMODES%s on %s", u->nick, all ? " ALL" : "", chan);
if (all)
{
/* Clear mode +o */
if (ircd->svsmode_ucmode)
- ircdproto->SendSVSModeChan(c->name, "-o", NULL);
+ ircdproto->SendSVSModeChan(c, "-o", NULL);
else
{
for (cu = c->users; cu; cu = next)
@@ -74,7 +74,7 @@ class CommandOSClearModes : public Command
/* Clear mode +v */
if (ircd->svsmode_ucmode)
- ircdproto->SendSVSModeChan(c->name, "-v", NULL);
+ ircdproto->SendSVSModeChan(c, "-v", NULL);
else
{
for (cu = c->users; cu; cu = next)
@@ -91,7 +91,7 @@ class CommandOSClearModes : public Command
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
{
if (ircd->svsmode_ucmode)
- ircdproto->SendSVSModeChan(c->name, "-h", NULL);
+ ircdproto->SendSVSModeChan(c, "-h", NULL);
else
{
for (cu = c->users; cu; cu = next)
@@ -112,7 +112,7 @@ class CommandOSClearModes : public Command
buf += cm->ModeChar;
if (ircd->svsmode_ucmode)
- ircdproto->SendSVSModeChan(c->name, buf.c_str(), NULL);
+ ircdproto->SendSVSModeChan(c, buf.c_str(), NULL);
else
{
for (cu = c->users; cu; cu = next)
@@ -133,7 +133,7 @@ class CommandOSClearModes : public Command
buf += cm->ModeChar;
if (ircd->svsmode_ucmode)
- ircdproto->SendSVSModeChan(c->name, buf.c_str(), NULL);
+ ircdproto->SendSVSModeChan(c, buf.c_str(), NULL);
else
{
for (cu = c->users; cu; cu = next)
diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c
index 326149bcb..4b427d602 100644
--- a/src/core/os_defcon.c
+++ b/src/core/os_defcon.c
@@ -37,7 +37,7 @@ class DefConTimeout : public Timer
Config.DefConLevel = level;
FOREACH_MOD(I_OnDefconLevel, OnDefconLevel(level));
alog("Defcon level timeout, returning to lvl %d", level);
- ircdproto->SendGlobops(Config.s_OperServ, getstring(OPER_DEFCON_WALL), Config.s_OperServ, level);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), getstring(OPER_DEFCON_WALL), Config.s_OperServ, level);
if (Config.GlobalOnDefcon)
{
@@ -96,7 +96,7 @@ class CommandOSDEFCON : public Command
notice_lang(Config.s_OperServ, u, OPER_DEFCON_CHANGED, Config.DefConLevel);
defcon_sendlvls(u);
alog("Defcon level changed to %d by Oper %s", newLevel, u->nick);
- ircdproto->SendGlobops(Config.s_OperServ, getstring(OPER_DEFCON_WALL), u->nick, newLevel);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), getstring(OPER_DEFCON_WALL), u->nick, newLevel);
/* Global notice the user what is happening. Also any Message that
the Admin would like to add. Set in config file. */
if (Config.GlobalOnDefcon)
@@ -299,7 +299,7 @@ class OSDEFCON : public Module
char akillmask[BUFSIZE];
snprintf(akillmask, sizeof(akillmask), "*@%s", u->host);
add_akill(NULL, akillmask, Config.s_OperServ, time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded");
- ircdproto->SendGlobops(Config.s_OperServ, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask);
}
}
}
diff --git a/src/core/os_global.c b/src/core/os_global.c
index 447c5fd5c..c311f0809 100644
--- a/src/core/os_global.c
+++ b/src/core/os_global.c
@@ -27,7 +27,7 @@ class CommandOSGlobal : public Command
const char *msg = params[0].c_str();
if (Config.WallOSGlobal)
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 just used GLOBAL command.", u->nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 just used GLOBAL command.", u->nick);
oper_global(u->nick, "%s", msg);
return MOD_CONT;
}
diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c
index 9c809c670..63274e4fc 100644
--- a/src/core/os_jupe.c
+++ b/src/core/os_jupe.c
@@ -41,7 +41,7 @@ class CommandOSJupe : public Command
ircdproto->SendServer(juped_server);
if (Config.WallOSJupe)
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 used JUPE on \2%s\2", u->nick, jserver);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 used JUPE on \2%s\2", u->nick, jserver);
}
return MOD_CONT;
}
diff --git a/src/core/os_kick.c b/src/core/os_kick.c
index 724a12c79..ea2b529de 100644
--- a/src/core/os_kick.c
+++ b/src/core/os_kick.c
@@ -27,6 +27,7 @@ class CommandOSKick : public Command
const char *argv[3];
const char *chan = params[0].c_str(), *nick = params[1].c_str(), *s = params[2].c_str();
Channel *c;
+ User *u2;
if (!(c = findchan(chan)))
{
@@ -38,11 +39,17 @@ class CommandOSKick : public Command
notice_lang(Config.s_OperServ, u, OPER_BOUNCY_MODES_U_LINE);
return MOD_CONT;
}
- ircdproto->SendKick(findbot(Config.s_OperServ), chan, nick, "%s (%s)", u->nick, s);
+ else if (!(u2 = finduser(nick)))
+ {
+ notice_lang(Config.s_OperServ, u, NICK_X_NOT_IN_USE, nick);
+ return MOD_CONT;
+ }
+
+ ircdproto->SendKick(findbot(Config.s_OperServ), c, u2, "%s (%s)", u->nick, s);
if (Config.WallOSKick)
- ircdproto->SendGlobops(Config.s_OperServ, "%s used KICK on %s/%s", u->nick, nick, chan);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s used KICK on %s/%s", u->nick, u2->nick, chan);
argv[0] = sstrdup(chan);
- argv[1] = sstrdup(nick);
+ argv[1] = sstrdup(u2->nick);
argv[2] = sstrdup(s);
do_kick(Config.s_OperServ, 3, argv);
delete [] argv[2];
diff --git a/src/core/os_mode.c b/src/core/os_mode.c
index af19bb6d5..beb225a0c 100644
--- a/src/core/os_mode.c
+++ b/src/core/os_mode.c
@@ -36,7 +36,7 @@ class CommandOSMode : public Command
c->SetModes(findbot(Config.s_OperServ), false, modes);
if (Config.WallOSMode)
- ircdproto->SendGlobops(Config.s_OperServ, "%s used MODE %s on %s", u->nick, modes, chan);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s used MODE %s on %s", u->nick, modes, chan);
}
return MOD_CONT;
}
diff --git a/src/core/os_noop.c b/src/core/os_noop.c
index 91194b02b..86d454d3b 100644
--- a/src/core/os_noop.c
+++ b/src/core/os_noop.c
@@ -38,7 +38,7 @@ class CommandOSNOOP : public Command
snprintf(reason, sizeof(reason), "NOOP command used by %s", u->nick);
if (Config.WallOSNoOp)
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 used NOOP on \2%s\2", u->nick, server);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 used NOOP on \2%s\2", u->nick, server);
notice_lang(Config.s_OperServ, u, OPER_NOOP_SET, server);
/* Kill all the IRCops of the server */
diff --git a/src/core/os_oline.c b/src/core/os_oline.c
index 883f9344e..d8c407ee5 100644
--- a/src/core/os_oline.c
+++ b/src/core/os_oline.c
@@ -37,13 +37,13 @@ class CommandOSOLine : public Command
u2->SetMode(UMODE_OPER);
notice_lang(Config.s_OperServ, u2, OPER_OLINE_IRCOP);
notice_lang(Config.s_OperServ, u, OPER_OLINE_SUCCESS, flag, nick);
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 used OLINE for %s", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 used OLINE for %s", u->nick, nick);
}
else if (u2 && flag[0] == '-')
{
ircdproto->SendSVSO(Config.s_OperServ, nick, flag);
notice_lang(Config.s_OperServ, u, OPER_OLINE_SUCCESS, flag, nick);
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 used OLINE for %s", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 used OLINE for %s", u->nick, nick);
}
else
this->OnSyntaxError(u, "");
diff --git a/src/core/os_set.c b/src/core/os_set.c
index 01bbd5f5b..745da0e47 100644
--- a/src/core/os_set.c
+++ b/src/core/os_set.c
@@ -124,7 +124,7 @@ class CommandOSSet : public Command
{
alog("No longer sending log messages to a channel");
if (ircd->join2msg)
- ircdproto->SendPart(findbot(Config.s_GlobalNoticer), Config.LogChannel, NULL);
+ ircdproto->SendPart(findbot(Config.s_GlobalNoticer), findchan(Config.LogChannel), NULL);
LogChan = false;
notice_lang(Config.s_OperServ, u, OPER_SET_LOGCHAN_OFF);
}
@@ -156,14 +156,14 @@ class CommandOSSet : public Command
u->isSuperAdmin = 1;
notice_lang(Config.s_OperServ, u, OPER_SUPER_ADMIN_ON);
alog("%s: %s is a SuperAdmin ", Config.s_OperServ, u->nick);
- ircdproto->SendGlobops(Config.s_OperServ, getstring(OPER_SUPER_ADMIN_WALL_ON), u->nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), getstring(OPER_SUPER_ADMIN_WALL_ON), u->nick);
}
else if (setting == "OFF")
{
u->isSuperAdmin = 0;
notice_lang(Config.s_OperServ, u, OPER_SUPER_ADMIN_OFF);
alog("%s: %s is no longer a SuperAdmin", Config.s_OperServ, u->nick);
- ircdproto->SendGlobops(Config.s_OperServ, getstring(OPER_SUPER_ADMIN_WALL_OFF), u->nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), getstring(OPER_SUPER_ADMIN_WALL_OFF), u->nick);
}
else
notice_lang(Config.s_OperServ, u, OPER_SUPER_ADMIN_SYNTAX);
diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c
index 6f9632eb8..a8563e1b2 100644
--- a/src/core/os_sgline.c
+++ b/src/core/os_sgline.c
@@ -129,7 +129,7 @@ class CommandOSSGLine : public Command
snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s");
}
- ircdproto->SendGlobops(Config.s_OperServ, "%s added an SGLINE for %s (%s)", u->nick, cmask, buf);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s added an SGLINE for %s (%s)", u->nick, cmask, buf);
}
if (readonly)
diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c
index b4018bcd0..9fe786d36 100644
--- a/src/core/os_sqline.c
+++ b/src/core/os_sqline.c
@@ -115,7 +115,7 @@ class CommandOSSQLine : public Command
snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s");
}
- ircdproto->SendGlobops(Config.s_OperServ, "%s added an SQLINE for %s (%s)", u->nick, mask, buf);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s added an SQLINE for %s (%s)", u->nick, mask, buf);
}
if (readonly)
diff --git a/src/core/os_svsnick.c b/src/core/os_svsnick.c
index b86caf601..67059fb80 100644
--- a/src/core/os_svsnick.c
+++ b/src/core/os_svsnick.c
@@ -26,6 +26,7 @@ class CommandOSSVSNick : public Command
{
const char *nick = params[0].c_str();
ci::string newnick = params[1];
+ User *u2;
NickAlias *na;
@@ -52,7 +53,7 @@ class CommandOSSVSNick : public Command
}
/* Check for a nick in use or a forbidden/suspended nick */
- if (!finduser(nick))
+ if (!(u2 = finduser(nick)))
notice_lang(Config.s_OperServ, u, NICK_X_NOT_IN_USE, nick);
else if (finduser(newnick.c_str()))
notice_lang(Config.s_OperServ, u, NICK_X_IN_USE, newnick.c_str());
@@ -61,8 +62,8 @@ class CommandOSSVSNick : public Command
else
{
notice_lang(Config.s_OperServ, u, OPER_SVSNICK_NEWNICK, nick, newnick.c_str());
- ircdproto->SendGlobops(Config.s_OperServ, "%s used SVSNICK to change %s to %s", u->nick, nick, newnick.c_str());
- ircdproto->SendForceNickChange(nick, newnick.c_str(), time(NULL));
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s used SVSNICK to change %s to %s", u->nick, nick, newnick.c_str());
+ ircdproto->SendForceNickChange(u2, newnick.c_str(), time(NULL));
}
return MOD_CONT;
}
diff --git a/src/core/os_szline.c b/src/core/os_szline.c
index 9beea2bc7..4b1661077 100644
--- a/src/core/os_szline.c
+++ b/src/core/os_szline.c
@@ -115,7 +115,7 @@ class CommandOSSZLine : public Command
snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s");
}
- ircdproto->SendGlobops(Config.s_OperServ, "%s added an SZLINE for %s (%s)", u->nick, mask, buf);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s added an SZLINE for %s (%s)", u->nick, mask, buf);
}
if (readonly)
diff --git a/src/core/os_umode.c b/src/core/os_umode.c
index 6f86dbd44..bf4faa34a 100644
--- a/src/core/os_umode.c
+++ b/src/core/os_umode.c
@@ -48,7 +48,7 @@ class CommandOSUMode : public Command
notice_lang(Config.s_OperServ, u2, OPER_UMODE_CHANGED, u->nick);
if (Config.WallOSMode)
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 used UMODE on %s", u->nick, nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 used UMODE on %s", u->nick, nick);
}
return MOD_CONT;
}
diff --git a/src/datafiles.c b/src/datafiles.c
index 920c0e5ef..5292361ac 100644
--- a/src/datafiles.c
+++ b/src/datafiles.c
@@ -18,7 +18,6 @@
#include <fcntl.h>
static int curday = 0;
-static time_t lastwarn = 0;
/*************************************************************************/
@@ -37,7 +36,7 @@ static void rename_database(const char *name, char *ext)
snprintf(destpath, sizeof(destpath), "backups/%s.%s", name, ext);
if (rename(name, destpath) != 0) {
alog("Backup of %s failed.", name);
- ircdproto->SendGlobops(Config.s_OperServ, "WARNING! Backup of %s failed.",
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "WARNING! Backup of %s failed.",
name);
}
}
diff --git a/src/hostserv.c b/src/hostserv.c
index 553f2e741..8be8ddc39 100644
--- a/src/hostserv.c
+++ b/src/hostserv.c
@@ -129,7 +129,7 @@ HostCore *createHostCorelist(HostCore * next, const char *nick, char *vIdent,
next = new HostCore;
if (next == NULL) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to create the vHost LL, problems i sense..");
} else {
next->nick = new char[strlen(nick) + 1];
@@ -139,7 +139,7 @@ HostCore *createHostCorelist(HostCore * next, const char *nick, char *vIdent,
next->vIdent = new char[strlen(vIdent) + 1];
if ((next->nick == NULL) || (next->vHost == NULL)
|| (next->creator == NULL)) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to create the vHost LL, problems i sense..");
return NULL;
}
@@ -148,7 +148,7 @@ HostCore *createHostCorelist(HostCore * next, const char *nick, char *vIdent,
strlcpy(next->creator, creator, strlen(creator) + 1);
if (vIdent) {
if ((next->vIdent == NULL)) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to create the vHost LL, problems i sense..");
return NULL;
}
@@ -217,7 +217,7 @@ HostCore *insertHostCore(HostCore * phead, HostCore * prev, const char *nick,
newCore = new HostCore;
if (newCore == NULL) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to insert into the vHost LL, problems i sense..");
return NULL;
} else {
@@ -228,7 +228,7 @@ HostCore *insertHostCore(HostCore * phead, HostCore * prev, const char *nick,
newCore->vIdent = new char[strlen(vIdent) + 1];
if ((newCore->nick == NULL) || (newCore->vHost == NULL)
|| (newCore->creator == NULL)) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to create the vHost LL, problems i sense..");
return NULL;
}
@@ -237,7 +237,7 @@ HostCore *insertHostCore(HostCore * phead, HostCore * prev, const char *nick,
strlcpy(newCore->creator, creator, strlen(creator) + 1);
if (vIdent) {
if ((newCore->vIdent == NULL)) {
- ircdproto->SendGlobops(Config.s_HostServ,
+ ircdproto->SendGlobops(findbot(Config.s_HostServ),
"Unable to allocate memory to create the vHost LL, problems i sense..");
return NULL;
}
@@ -385,7 +385,7 @@ int do_on_id(User * u)
} else {
notice_lang(Config.s_HostServ, u, HOST_ACTIVATED, vHost);
}
- ircdproto->SendVhost(u->nick, vIdent, vHost);
+ ircdproto->SendVhost(u, vIdent, vHost);
if (ircd->vhost)
{
if (u->vhost)
diff --git a/src/messages.c b/src/messages.c
index 2e00a03f0..44447ff87 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -174,7 +174,7 @@ int m_privmsg(const char *source, const char *receiver, const char *msg)
{
notice_lang(Config.s_OperServ, u, ACCESS_DENIED);
if (Config.WallBadOS)
- ircdproto->SendGlobops(Config.s_OperServ, "Denied access to %s from %s!%s@%s (non-oper)", Config.s_OperServ, u->nick, u->GetIdent().c_str(), u->host);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "Denied access to %s from %s!%s@%s (non-oper)", Config.s_OperServ, u->nick, u->GetIdent().c_str(), u->host);
}
else
operserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index 2c0694edc..813bc2d50 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -246,7 +246,7 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
if (u)
{
- ircdproto->SendGlobops(Config.s_OperServ, "%s loaded module %s", u->nick, modname.c_str());
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s loaded module %s", u->nick, modname.c_str());
notice_lang(Config.s_OperServ, u, OPER_MODULE_LOADED, modname.c_str());
/* If a user is loading this module, then the core databases have already been loaded
@@ -276,7 +276,7 @@ int ModuleManager::UnloadModule(Module *m, User *u)
if (u)
{
- ircdproto->SendGlobops(Config.s_OperServ, "%s unloaded module %s", u->nick, m->name.c_str());
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s unloaded module %s", u->nick, m->name.c_str());
notice_lang(Config.s_OperServ, u, OPER_MODULE_UNLOADED, m->name.c_str());
}
diff --git a/src/modules/cs_appendtopic.c b/src/modules/cs_appendtopic.c
index 96cef82b7..1fa885559 100644
--- a/src/modules/cs_appendtopic.c
+++ b/src/modules/cs_appendtopic.c
@@ -105,11 +105,11 @@ class CommandCSAppendTopic : public Command
ircdproto->SendMode(NULL, c->name, "+o %s", Config.s_ChanServ);
}
}
- ircdproto->SendTopic(whosends(ci), c->name, u->nick, topic, c->topic_time);
+ ircdproto->SendTopic(whosends(ci), c, u->nick, topic);
if (ircd->join2set)
{
if (whosends(ci) == findbot(Config.s_ChanServ))
- ircdproto->SendPart(findbot(Config.s_ChanServ), c->name, NULL);
+ ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL);
}
}
return MOD_CONT;
diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c
index d02ddd224..2bf692233 100644
--- a/src/modules/cs_enforce.c
+++ b/src/modules/cs_enforce.c
@@ -121,7 +121,7 @@ class CommandCSEnforce : public Command
get_idealban(ci, u, mask, sizeof(mask));
reason = getstring(u, CHAN_NOT_ALLOWED_TO_JOIN);
c->SetMode(NULL, CMODE_BAN, mask);
- ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
+ ircdproto->SendKick(whosends(ci), ci->c, u, "%s", reason);
av[0] = ci->name;
av[1] = u->nick;
av[2] = reason;
@@ -162,7 +162,7 @@ class CommandCSEnforce : public Command
{
c->SetMode(NULL, CMODE_BAN, mask);
}
- ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
+ ircdproto->SendKick(whosends(ci), ci->c, u, "%s", reason);
av[0] = ci->name;
av[1] = u->nick;
av[2] = reason;
diff --git a/src/modules/os_info.c b/src/modules/os_info.c
index f439a362f..194e2e8ee 100644
--- a/src/modules/os_info.c
+++ b/src/modules/os_info.c
@@ -550,7 +550,7 @@ class OSInfo : public Module
if (!(out = fopen(OSInfoDBName, "w")))
{
alog("os_info: ERROR: can not open the database file!");
- ircdproto->SendGlobops(Config.s_OperServ, "os_info: ERROR: can not open the database file!");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "os_info: ERROR: can not open the database file!");
ret = 1;
}
else
diff --git a/src/nickserv.c b/src/nickserv.c
index e44441379..81b210d97 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -367,7 +367,7 @@ void cancel_user(User * u)
}
else
{
- ircdproto->SendSVSKill(Config.s_NickServ, u->nick, "Please do not use a registered nickname without identifying");
+ ircdproto->SendSVSKill(findbot(Config.s_NickServ), u, "Please do not use a registered nickname without identifying");
}
na->SetFlag(NS_KILL_HELD);
}
@@ -779,6 +779,10 @@ void collide(NickAlias * na, int from_timeout)
if (ircd->svsnick)
{
+ User *u = finduser(na->nick);
+ if (!u)
+ return;
+
/* We need to make sure the guestnick is free -- heinz */
do
{
@@ -787,7 +791,7 @@ void collide(NickAlias * na, int from_timeout)
}
while (finduser(guestnick));
notice_lang(Config.s_NickServ, finduser(na->nick), FORCENICKCHANGE_CHANGING, guestnick);
- ircdproto->SendForceNickChange(na->nick, guestnick, time(NULL));
+ ircdproto->SendForceNickChange(u, guestnick, time(NULL));
na->SetFlag(NS_GUESTED);
}
else
diff --git a/src/operserv.c b/src/operserv.c
index 733e69982..d2711aaec 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -311,8 +311,7 @@ int add_akill(User * u, const char *mask, const char *by, const time_t expires,
slist_add(&akills, entry);
if (Config.AkillOnAdd)
- ircdproto->SendAkill(entry->user, entry->host, entry->by, entry->seton,
- entry->expires, entry->reason);
+ ircdproto->SendAkill(entry);
delete [] mask2;
@@ -336,16 +335,14 @@ int check_akill(const char *nick, const char *username, const char *host,
continue;
if (Anope::Match(username, ak->user, false)
&& Anope::Match(host, ak->host, false)) {
- ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
- ak->expires, ak->reason);
+ ircdproto->SendAkill(ak);
return 1;
}
if (ircd->vhost) {
if (vhost) {
if (Anope::Match(username, ak->user, false)
&& Anope::Match(vhost, ak->host, false)) {
- ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
- ak->expires, ak->reason);
+ ircdproto->SendAkill(ak);
return 1;
}
}
@@ -354,8 +351,7 @@ int check_akill(const char *nick, const char *username, const char *host,
if (ip) {
if (Anope::Match(username, ak->user, false)
&& Anope::Match(ip, ak->host, false)) {
- ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
- ak->expires, ak->reason);
+ ircdproto->SendAkill(ak);
return 1;
}
}
@@ -381,7 +377,7 @@ void expire_akills()
continue;
if (Config.WallAkillExpire)
- ircdproto->SendGlobops(Config.s_OperServ, "AKILL on %s@%s has expired",
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "AKILL on %s@%s has expired",
ak->user, ak->host);
slist_delete(&akills, i);
}
@@ -392,7 +388,7 @@ static void free_akill_entry(SList * slist, void *item)
Akill *ak = static_cast<Akill *>(item);
/* Remove the AKILLs from all the servers */
- ircdproto->SendAkillDel(ak->user, ak->host);
+ ircdproto->SendAkillDel(ak);
/* Free the structure */
delete [] ak->user;
@@ -510,7 +506,7 @@ int add_sgline(User * u, const char *mask, const char *by, time_t expires,
slist_add(&sglines, entry);
- ircdproto->SendSGLine(entry->mask, entry->reason);
+ ircdproto->SendSGLine(entry);
if (Config.KillonSGline && !ircd->sglineenforce) {
snprintf(buf, (BUFSIZE - 1), "G-Lined: %s", entry->reason);
@@ -544,9 +540,9 @@ int check_sgline(const char *nick, const char *realname)
continue;
if (Anope::Match(realname, sx->mask, false)) {
- ircdproto->SendSGLine(sx->mask, sx->reason);
+ ircdproto->SendSGLine(sx);
/* We kill nick since s_sgline can't */
- ircdproto->SendSVSKill(Config.ServerName, nick, "G-Lined: %s", sx->reason);
+ ircdproto->SendSVSKill(NULL, finduser(nick), "G-Lined: %s", sx->reason);
return 1;
}
}
@@ -569,7 +565,7 @@ void expire_sglines()
continue;
if (Config.WallSGLineExpire)
- ircdproto->SendGlobops(Config.s_OperServ, "SGLINE on \2%s\2 has expired",
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "SGLINE on \2%s\2 has expired",
sx->mask);
slist_delete(&sglines, i);
}
@@ -580,7 +576,7 @@ static void free_sgline_entry(SList * slist, void *item)
SXLine *sx = static_cast<SXLine *>(item);
/* Remove the SGLINE from all the servers */
- ircdproto->SendSGLineDel(sx->mask);
+ ircdproto->SendSGLineDel(sx);
/* Free the structure */
delete [] sx->mask;
@@ -789,7 +785,7 @@ void expire_sqlines()
continue;
if (Config.WallSQLineExpire)
- ircdproto->SendGlobops(Config.s_OperServ, "SQLINE on \2%s\2 has expired",
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "SQLINE on \2%s\2 has expired",
sx->mask);
slist_delete(&sqlines, i);
@@ -908,7 +904,7 @@ int add_szline(User * u, const char *mask, const char *by, time_t expires,
entry->expires = expires;
slist_add(&szlines, entry);
- ircdproto->SendSZLine(entry->mask, entry->reason, entry->by);
+ ircdproto->SendSZLine(entry);
return deleted;
}
@@ -934,7 +930,7 @@ int check_szline(const char *nick, char *ip)
}
if (Anope::Match(ip, sx->mask, false)) {
- ircdproto->SendSZLine(sx->mask, sx->reason, sx->by);
+ ircdproto->SendSZLine(sx);
return 1;
}
}
@@ -958,7 +954,7 @@ void expire_szlines()
continue;
if (Config.WallSZLineExpire)
- ircdproto->SendGlobops(Config.s_OperServ, "SZLINE on \2%s\2 has expired",
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "SZLINE on \2%s\2 has expired",
sx->mask);
slist_delete(&szlines, i);
}
@@ -969,7 +965,7 @@ static void free_szline_entry(SList * slist, void *item)
SXLine *sx = static_cast<SXLine *>(item);
/* Remove the SZLINE from all the servers */
- ircdproto->SendSZLineDel(sx->mask);
+ ircdproto->SendSZLineDel(sx);
/* Free the structure */
delete [] sx->mask;
diff --git a/src/protocol.cpp b/src/protocol.cpp
index e80254863..efeb43990 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -26,19 +26,18 @@ void IRCDProto::SendQuitInternal(BotInfo *bi, const char *buf)
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "QUIT");
}
-void IRCDProto::SendPartInternal(BotInfo *bi, const char *chan, const char *buf)
+void IRCDProto::SendPartInternal(BotInfo *bi, Channel *chan, const char *buf)
{
if (buf)
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s :%s", chan, buf);
+ send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s :%s", chan->name, buf);
else
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s", chan);
+ send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s", chan->name);
}
-void IRCDProto::SendGlobopsInternal(const char *source, const char *buf)
+void IRCDProto::SendGlobopsInternal(BotInfo *source, const char *buf)
{
- BotInfo *bi = findbot(source);
- if (bi)
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "GLOBOPS :%s", buf);
+ if (source)
+ send_cmd(ircd->ts6 ? source->uid : source->nick, "GLOBOPS :%s", buf);
else
send_cmd(Config.ServerName, "GLOBOPS :%s", buf);
}
@@ -55,8 +54,11 @@ void IRCDProto::SendNumericInternal(const char *source, int numeric, const char
send_cmd(source, "%03d %s %s", numeric, dest, buf);
}
-void IRCDProto::SendSVSKill(const char *source, const char *user, const char *fmt, ...)
+void IRCDProto::SendSVSKill(BotInfo *source, User *user, const char *fmt, ...)
{
+ if (!user || !fmt)
+ return;
+
va_list args;
char buf[BUFSIZE] = "";
va_start(args, fmt);
@@ -85,8 +87,11 @@ void IRCDProto::SendMode(User *u, const char *fmt, ...)
SendModeInternal(u, buf);
}
-void IRCDProto::SendKick(BotInfo *bi, const char *chan, const char *user, const char *fmt, ...)
+void IRCDProto::SendKick(BotInfo *bi, Channel *chan, User *user, const char *fmt, ...)
{
+ if (!bi || !chan || !user)
+ return;
+
va_list args;
char buf[BUFSIZE] = "";
va_start(args, fmt);
@@ -95,7 +100,7 @@ void IRCDProto::SendKick(BotInfo *bi, const char *chan, const char *user, const
SendKickInternal(bi, chan, user, buf);
}
-void IRCDProto::SendNoticeChanops(BotInfo *bi, const char *dest, const char *fmt, ...)
+void IRCDProto::SendNoticeChanops(BotInfo *bi, Channel *dest, const char *fmt, ...)
{
va_list args;
char buf[BUFSIZE] = "";
@@ -146,14 +151,14 @@ void IRCDProto::SendPrivmsg(BotInfo *bi, const char *dest, const char *fmt, ...)
SendPrivmsgInternal(bi, dest, buf);
}
-void IRCDProto::SendGlobalNotice(BotInfo *bi, const char *dest, const char *msg)
+void IRCDProto::SendGlobalNotice(BotInfo *bi, Server *dest, const char *msg)
{
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest, msg);
+ send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest->name, msg);
}
-void IRCDProto::SendGlobalPrivmsg(BotInfo *bi, const char *dest, const char *msg)
+void IRCDProto::SendGlobalPrivmsg(BotInfo *bi, Server *dest, const char *msg)
{
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest, msg);
+ send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest->name, msg);
}
void IRCDProto::SendQuit(const char *nick, const char *)
@@ -190,7 +195,7 @@ void IRCDProto::SendInvite(BotInfo *bi, const char *chan, const char *nick)
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "INVITE %s %s", nick, chan);
}
-void IRCDProto::SendPart(BotInfo *bi, const char *chan, const char *fmt, ...)
+void IRCDProto::SendPart(BotInfo *bi, Channel *chan, const char *fmt, ...)
{
if (fmt)
{
@@ -204,7 +209,7 @@ void IRCDProto::SendPart(BotInfo *bi, const char *chan, const char *fmt, ...)
else SendPartInternal(bi, chan, NULL);
}
-void IRCDProto::SendGlobops(const char *source, const char *fmt, ...)
+void IRCDProto::SendGlobops(BotInfo *source, const char *fmt, ...)
{
va_list args;
char buf[BUFSIZE] = "";
@@ -223,9 +228,9 @@ void IRCDProto::SendChangeBotNick(BotInfo *bi, const char *newnick)
{
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NICK %s %ld", newnick, static_cast<long>(time(NULL)));
}
-void IRCDProto::SendForceNickChange(const char *oldnick, const char *newnick, time_t when)
+void IRCDProto::SendForceNickChange(User *u, const char *newnick, time_t when)
{
- send_cmd(NULL, "SVSNICK %s %s :%ld", oldnick, newnick, static_cast<long>(when));
+ send_cmd(NULL, "SVSNICK %s %s :%ld", u->nick, newnick, static_cast<long>(when));
}
void IRCDProto::SendCTCP(BotInfo *bi, const char *dest, const char *fmt, ...)
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c
index d60641378..288b36329 100644
--- a/src/protocol/bahamut.c
+++ b/src/protocol/bahamut.c
@@ -167,16 +167,16 @@ class BahamutIRCdProto : public IRCDProto
}
/* SVSMODE -b */
- void SendBanDel(const char *name, const char *nick)
+ void SendBanDel(Channel *c, const char *nick)
{
- SendSVSModeChan(name, "-b", nick);
+ SendSVSModeChan(c, "-b", nick);
}
/* SVSMODE channel modes */
- void SendSVSModeChan(const char *name, const char *mode, const char *nick)
+ void SendSVSModeChan(Channel *c, const char *mode, const char *nick)
{
- if (nick) send_cmd(Config.ServerName, "SVSMODE %s %s %s", name, mode, nick);
- else send_cmd(Config.ServerName, "SVSMODE %s %s", name, mode);
+ if (nick) send_cmd(Config.ServerName, "SVSMODE %s %s %s", c->name, mode, nick);
+ else send_cmd(Config.ServerName, "SVSMODE %s %s", c->name, mode);
}
/* SQLINE */
@@ -187,27 +187,27 @@ class BahamutIRCdProto : public IRCDProto
}
/* UNSGLINE */
- void SendSGLineDel(const char *mask)
+ void SendSGLineDel(SXLine *sx)
{
- send_cmd(NULL, "UNSGLINE 0 :%s", mask);
+ send_cmd(NULL, "UNSGLINE 0 :%s", sx->mask);
}
/* UNSZLINE */
- void SendSZLineDel(const char *mask)
+ void SendSZLineDel(SXLine *sx)
{
/* this will likely fail so its only here for legacy */
- send_cmd(NULL, "UNSZLINE 0 %s", mask);
+ send_cmd(NULL, "UNSZLINE 0 %s", sx->mask);
/* this is how we are supposed to deal with it */
- send_cmd(NULL, "RAKILL %s *", mask);
+ send_cmd(NULL, "RAKILL %s *", sx->mask);
}
/* SZLINE */
- void SendSZLine(const char *mask, const char *reason, const char *whom)
+ void SendSZLine(SXLine *sx)
{
/* this will likely fail so its only here for legacy */
- send_cmd(NULL, "SZLINE %s :%s", mask, reason);
+ send_cmd(NULL, "SZLINE %s :%s", sx->mask, sx->reason);
/* this is how we are supposed to deal with it */
- send_cmd(NULL, "AKILL %s * %d %s %ld :%s", mask, 172800, whom, static_cast<long>(time(NULL)), reason);
+ send_cmd(NULL, "AKILL %s * %d %s %ld :%s", sx->mask, 172800, sx->by, static_cast<long>(time(NULL)), sx->reason);
}
/* SVSNOOP */
@@ -217,21 +217,21 @@ class BahamutIRCdProto : public IRCDProto
}
/* SGLINE */
- void SendSGLine(const char *mask, const char *reason)
+ void SendSGLine(SXLine *sx)
{
- send_cmd(NULL, "SGLINE %d :%s:%s", static_cast<int>(strlen(mask)), mask, reason);
+ send_cmd(NULL, "SGLINE %d :%s:%s", static_cast<int>(strlen(sx->mask)), sx->mask, sx->reason);
}
/* RAKILL */
- void SendAkillDel(const char *user, const char *host)
+ void SendAkillDel(Akill *ak)
{
- send_cmd(NULL, "RAKILL %s %s", host, user);
+ send_cmd(NULL, "RAKILL %s %s", ak->host, ak->user);
}
/* TOPIC */
- void SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when)
+ void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic)
{
- send_cmd(whosets->nick, "TOPIC %s %s %lu :%s", chan, whosetit, static_cast<unsigned long>(when), topic);
+ send_cmd(whosets->nick, "TOPIC %s %s %lu :%s", c->name, whosetit, static_cast<unsigned long>(c->topic_time), topic);
}
/* UNSQLINE */
@@ -246,35 +246,20 @@ class BahamutIRCdProto : public IRCDProto
send_cmd(user->nick, "SJOIN %ld %s", static_cast<long>(chantime), channel);
}
- /* AKILL
- * parv[1]=host
- * parv[2]=user
- * parv[3]=length
- * parv[4]=akiller
- * parv[5]=time set
- * parv[6]=reason
- */
- void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ void SendAkill(Akill *ak)
{
// Calculate the time left before this would expire, capping it at 2 days
- time_t timeleft = expires - time(NULL);
+ time_t timeleft = ak->expires - time(NULL);
if (timeleft > 172800) timeleft = 172800;
- send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, static_cast<int>(timeleft), who, static_cast<long>(time(NULL)), reason);
+ send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", ak->host, ak->user, static_cast<int>(timeleft), ak->by, static_cast<long>(time(NULL)), ak->reason);
}
- /* SVSKILL */
- /* parv[0] = servername
- * parv[1] = client
- * parv[2] = nick stamp
- * parv[3] = kill message
- */
/*
Note: if the stamp is null 0, the below usage is correct of Bahamut
*/
- void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ void SendSVSKillInternal(BotInfo *source, User *user, const char *buf)
{
- if (!source || !user || !buf) return;
- send_cmd(source, "SVSKILL %s :%s", user, buf);
+ send_cmd(source ? source->nick : NULL, "SVSKILL %s :%s", user->nick, buf);
}
/* SVSMODE */
@@ -294,16 +279,16 @@ class BahamutIRCdProto : public IRCDProto
send_cmd(NULL, "BURST 0");
}
- void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const char *buf)
{
if (!buf) return;
- send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
+ send_cmd(NULL, "NOTICE @%s :%s", dest->name, buf);
}
- void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
+ void SendKickInternal(BotInfo *source, Channel *chan, User *user, const char *buf)
{
- if (buf) send_cmd(source->nick, "KICK %s %s :%s", chan, user, buf);
- else send_cmd(source->nick, "KICK %s %s", chan, user);
+ if (buf) send_cmd(source->nick, "KICK %s %s :%s", chan->name, user->nick, buf);
+ else send_cmd(source->nick, "KICK %s %s", chan->name, user->nick);
}
void SendClientIntroduction(const char *nick, const char *user, const char *host, const char *real, const char *modes, const char *uid)
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index b6c24bf18..84aa044de 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -129,14 +129,14 @@ static int has_hidechansmod = 0;
/* CHGHOST */
void inspircd_cmd_chghost(const char *nick, const char *vhost)
{
- if (has_chghostmod == 1) {
- if (!nick || !vhost) {
- return;
- }
- send_cmd(Config.s_OperServ, "CHGHOST %s %s", nick, vhost);
- } else {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGHOST not loaded!");
+ if (has_chghostmod == 1)
+ {
+ if (!nick || !vhost)
+ return;
+ send_cmd(Config.s_OperServ, "CHGHOST %s %s", nick, vhost);
}
+ else
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGHOST not loaded!");
}
int anope_event_idle(const char *source, int ac, const char **av)
@@ -158,14 +158,14 @@ void inspircd_cmd_pass(const char *pass)
class InspIRCdProto : public IRCDProto
{
- void SendAkillDel(const char *user, const char *host)
+ void SendAkillDel(Akill *ak)
{
- send_cmd(Config.s_OperServ, "GLINE %s@%s", user, host);
+ send_cmd(Config.s_OperServ, "GLINE %s@%s", ak->user, ak->host);
}
- void SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when)
+ void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic)
{
- send_cmd(whosets->nick, "FTOPIC %s %lu %s :%s", chan, static_cast<unsigned long>(when), whosetit, topic);
+ send_cmd(whosets->nick, "FTOPIC %s %lu %s :%s", c->name, static_cast<unsigned long>(c->topic_time), whosetit, topic);
}
void SendVhostDel(User *u)
@@ -181,19 +181,18 @@ class InspIRCdProto : public IRCDProto
}
}
- void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ void SendAkill(Akill *ak)
{
// Calculate the time left before this would expire, capping it at 2 days
- time_t timeleft = expires - time(NULL);
+ time_t timeleft = ak->expires - time(NULL);
if (timeleft > 172800)
timeleft = 172800;
- send_cmd(Config.ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, static_cast<long>(time(NULL)), static_cast<long>(timeleft), reason);
+ send_cmd(Config.ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL)), static_cast<long>(timeleft), ak->reason);
}
- void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ void SendSVSKillInternal(BotInfo *source, User *user, const char *buf)
{
- if (!buf || !source || !user) return;
- send_cmd(source, "KILL %s :%s", user, buf);
+ send_cmd(source ? source->nick : Config.ServerName, "KILL %s :%s", user->nick, buf);
}
void SendSVSMode(User *u, int ac, const char **av)
@@ -230,16 +229,16 @@ class InspIRCdProto : public IRCDProto
send_cmd(nick, "OPERTYPE Service");
}
- void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
+ void SendKickInternal(BotInfo *source, Channel *chan, User *user, const char *buf)
{
- if (buf) send_cmd(source->nick, "KICK %s %s :%s", chan, user, buf);
- else send_cmd(source->nick, "KICK %s %s :%s", chan, user, user);
+ if (buf) send_cmd(source->nick, "KICK %s %s :%s", chan->name, user->nick, buf);
+ else send_cmd(source->nick, "KICK %s %s :%s", chan->name, user->nick, user->nick);
}
- void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const char *buf)
{
if (!buf) return;
- send_cmd(Config.ServerName, "NOTICE @%s :%s", dest, buf);
+ send_cmd(Config.ServerName, "NOTICE @%s :%s", dest->name, buf);
}
/* SERVER services-dev.chatspike.net password 0 :Description here */
@@ -277,11 +276,10 @@ class InspIRCdProto : public IRCDProto
/* Functions that use serval cmd functions */
- void SendVhost(const char *nick, const char *vIdent, const char *vhost)
+ void SendVhost(User *u, const char *vIdent, const char *vhost)
{
- if (!nick) return;
- if (vIdent) inspircd_cmd_chgident(nick, vIdent);
- inspircd_cmd_chghost(nick, vhost);
+ if (vIdent) inspircd_cmd_chgident(u->nick, vIdent);
+ inspircd_cmd_chghost(u->nick, vhost);
}
void SendConnect()
@@ -302,7 +300,7 @@ class InspIRCdProto : public IRCDProto
}
send_cmd(Config.s_OperServ, "CHGIDENT %s %s", nick, vIdent);
} else {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGIDENT not loaded!");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGIDENT not loaded!");
}
}
@@ -319,15 +317,15 @@ class InspIRCdProto : public IRCDProto
}
/* UNSZLINE */
- void SendSZLineDel(const char *mask)
+ void SendSZLineDel(SXLine *sx)
{
- send_cmd(Config.s_OperServ, "ZLINE %s", mask);
+ send_cmd(Config.s_OperServ, "ZLINE %s", sx->mask);
}
/* SZLINE */
- void SendSZLine(const char *mask, const char *reason, const char *whom)
+ void SendSZLine(SXLine *sx)
{
- send_cmd(Config.ServerName, "ADDLINE Z %s %s %ld 0 :%s", mask, whom, static_cast<long>(time(NULL)), reason);
+ send_cmd(Config.ServerName, "ADDLINE Z %s %s %ld 0 :%s", sx->mask, sx->by, static_cast<long>(time(NULL)), sx->reason);
}
/* SVSMODE +- */
@@ -905,13 +903,13 @@ int anope_event_capab(const char *source, int ac, const char **av)
return MOD_STOP;
}
if (!has_svsholdmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "SVSHOLD missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "SVSHOLD missing, Usage disabled until module is loaded.");
}
if (!has_chghostmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGHOST missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGHOST missing, Usage disabled until module is loaded.");
}
if (!has_chgidentmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGIDENT missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGIDENT missing, Usage disabled until module is loaded.");
}
if (has_messagefloodmod) {
ModeManager::AddChannelMode('f', new ChannelModeFlood());
diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp
index 30d64f7fa..2b232fe81 100644
--- a/src/protocol/inspircd12.cpp
+++ b/src/protocol/inspircd12.cpp
@@ -134,7 +134,7 @@ void inspircd_cmd_chghost(const char *nick, const char *vhost)
{
if (has_chghostmod != 1)
{
- ircdproto->SendGlobops(Config.s_OperServ, "CHGHOST not loaded!");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGHOST not loaded!");
return;
}
@@ -163,15 +163,15 @@ void inspircd_cmd_pass(const char *pass)
class InspIRCdProto : public IRCDProto
{
- void SendAkillDel(const char *user, const char *host)
+ void SendAkillDel(Akill *ak)
{
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi->uid, "GLINE %s@%s", user, host);
+ send_cmd(bi->uid, "GLINE %s@%s", ak->user, ak->host);
}
- void SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when)
+ void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic)
{
- send_cmd(whosets->uid, "FTOPIC %s %lu %s :%s", chan, static_cast<unsigned long>(when), whosetit, topic);
+ send_cmd(whosets->uid, "FTOPIC %s %lu %s :%s", c->name, static_cast<unsigned long>(c->topic_time), whosetit, topic);
}
void SendVhostDel(User *u)
@@ -187,21 +187,19 @@ class InspIRCdProto : public IRCDProto
}
}
- void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ void SendAkill(Akill *ak)
{
// Calculate the time left before this would expire, capping it at 2 days
- time_t timeleft = expires - time(NULL);
- if (timeleft > 172800 || !expires)
+ time_t timeleft = ak->expires - time(NULL);
+ if (timeleft > 172800 || !ak->expires)
timeleft = 172800;
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi->uid, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, static_cast<long>(time(NULL)), static_cast<long>(timeleft), reason);
+ send_cmd(bi->uid, "ADDLINE G %s@%s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL)), static_cast<long>(timeleft), ak->reason);
}
- void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ void SendSVSKillInternal(BotInfo *source, User *user, const char *buf)
{
- BotInfo *bi = findbot(source);
- User *u = finduser(user);
- send_cmd(bi ? bi->uid : TS6SID, "KILL %s :%s", u ? u->GetUID().c_str(): user, buf);
+ send_cmd(source ? source->uid : TS6SID, "KILL %s :%s", user->GetUID().c_str(), buf);
}
void SendSVSMode(User *u, int ac, const char **av)
@@ -236,18 +234,17 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "UID %s %ld %s %s %s %s 0.0.0.0 %ld %s :%s", uid, static_cast<long>(time(NULL)), nick, host, host, user, static_cast<long>(time(NULL)), modes, real);
}
- void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
+ void SendKickInternal(BotInfo *source, Channel *chan, User *user, const char *buf)
{
- User *u = finduser(user);
if (buf)
- send_cmd(source->uid, "KICK %s %s :%s", chan, u->GetUID().c_str(), buf);
+ send_cmd(source->uid, "KICK %s %s :%s", chan->name, user->GetUID().c_str(), buf);
else
- send_cmd(source->uid, "KICK %s %s :%s", chan, u->GetUID().c_str(), user);
+ send_cmd(source->uid, "KICK %s %s :%s", chan->name, user->GetUID().c_str(), user->nick);
}
- void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const char *buf)
{
- send_cmd(TS6SID, "NOTICE @%s :%s", dest, buf);
+ send_cmd(TS6SID, "NOTICE @%s :%s", dest->name, buf);
}
/* SERVER services-dev.chatspike.net password 0 :Description here */
@@ -282,11 +279,11 @@ class InspIRCdProto : public IRCDProto
/* Functions that use serval cmd functions */
- void SendVhost(const char *nick, const char *vIdent, const char *vhost)
+ void SendVhost(User *u, const char *vIdent, const char *vhost)
{
if (vIdent)
- inspircd_cmd_chgident(nick, vIdent);
- inspircd_cmd_chghost(nick, vhost);
+ inspircd_cmd_chgident(u->nick, vIdent);
+ inspircd_cmd_chghost(u->nick, vhost);
}
void SendConnect()
@@ -303,7 +300,7 @@ class InspIRCdProto : public IRCDProto
{
if (has_chgidentmod == 0)
{
- ircdproto->SendGlobops(Config.s_OperServ, "CHGIDENT not loaded!");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGIDENT not loaded!");
}
else
{
@@ -327,15 +324,15 @@ class InspIRCdProto : public IRCDProto
}
/* UNSZLINE */
- void SendSZLineDel(const char *mask)
+ void SendSZLineDel(SXLine *sx)
{
- send_cmd(TS6SID, "DELLINE Z %s", mask);
+ send_cmd(TS6SID, "DELLINE Z %s", sx->mask);
}
/* SZLINE */
- void SendSZLine(const char *mask, const char *reason, const char *whom)
+ void SendSZLine(SXLine *sx)
{
- send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", mask, whom, static_cast<long>(time(NULL)), reason);
+ send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", sx->mask, sx->by, static_cast<long>(time(NULL)), sx->reason);
}
/* SVSMODE -r */
@@ -370,16 +367,12 @@ class InspIRCdProto : public IRCDProto
send_cmd(TS6SID, "ENDBURST");
}
- void SendGlobopsInternal(const char *source, const char *buf)
+ void SendGlobopsInternal(BotInfo *source, const char *buf)
{
- BotInfo *bi = findbot(source);
- if (bi)
- {
- if (has_globopsmod)
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "SNONOTICE g :%s", buf);
- else
- send_cmd(ircd->ts6 ? bi->uid : bi->nick, "SNONOTICE A :%s", buf);
- }
+ if (has_globopsmod)
+ send_cmd(source ? source->uid : TS6SID, "SNONOTICE g :%s", buf);
+ else
+ send_cmd(source ? source->uid : TS6SID, "SNONOTICE A :%s", buf);
}
void SendAccountLogin(User *u, NickCore *account)
@@ -1079,18 +1072,18 @@ int anope_event_capab(const char *source, int ac, const char **av)
}
if (!has_hidechansmod) {
send_cmd(NULL, "ERROR :m_hidechans.so is not loaded. This is required by Anope");
- quitmsg = "ERROR: Remote server deos not have the m_hidechans module loaded, and this is required.";
+ quitmsg = "ERROR: Remote server does not have the m_hidechans module loaded, and this is required.";
quitting = 1;
return MOD_STOP;
}
if (!has_svsholdmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "SVSHOLD missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "SVSHOLD missing, Usage disabled until module is loaded.");
}
if (!has_chghostmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGHOST missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGHOST missing, Usage disabled until module is loaded.");
}
if (!has_chgidentmod) {
- ircdproto->SendGlobops(Config.s_OperServ, "CHGIDENT missing, Usage disabled until module is loaded.");
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "CHGIDENT missing, Usage disabled until module is loaded.");
}
if (has_messagefloodmod) {
ModeManager::AddChannelMode('f', new ChannelModeFlood());
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index 249f8b685..3996bf736 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -165,18 +165,12 @@ void ratbox_cmd_pass(const char *pass)
class RatboxProto : public IRCDTS6Proto
{
- void SendGlobopsInternal(const char *source, const char *buf)
+ void SendGlobopsInternal(BotInfo *source, const char *buf)
{
if (source)
- {
- BotInfo *bi = findbot(source);
- if (bi)
- {
- send_cmd(bi->uid, "OPERWALL :%s", buf);
- return;
- }
- }
- send_cmd(TS6SID, "OPERWALL :%s", buf);
+ send_cmd(source->uid, "OPERWALL :%s", buf);
+ else
+ send_cmd(TS6SID, "OPERWALL :%s", buf);
}
void SendSQLine(const char *mask, const char *reason)
@@ -184,22 +178,22 @@ class RatboxProto : public IRCDTS6Proto
send_cmd(TS6SID, "RESV * %s :%s", mask, reason);
}
- void SendSGLineDel(const char *mask)
+ void SendSGLineDel(SXLine *sx)
{
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi ? bi->uid : Config.s_OperServ, "UNXLINE * %s", mask);
+ send_cmd(bi ? bi->uid : Config.s_OperServ, "UNXLINE * %s", sx->mask);
}
- void SendSGLine(const char *mask, const char *reason)
+ void SendSGLine(SXLine *sx)
{
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi ? bi->uid : Config.s_OperServ, "XLINE * %s 0 :%s", mask, reason);
+ send_cmd(bi ? bi->uid : Config.s_OperServ, "XLINE * %s 0 :%s", sx->mask, sx->reason);
}
- void SendAkillDel(const char *user, const char *host)
+ void SendAkillDel(Akill *ak)
{
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi ? bi->uid : Config.s_OperServ, "UNKLINE * %s %s", user, host);
+ send_cmd(bi ? bi->uid : Config.s_OperServ, "UNKLINE * %s %s", ak->user, ak->host);
}
void SendSQLineDel(const char *user)
@@ -212,26 +206,15 @@ class RatboxProto : public IRCDTS6Proto
send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, user->uid.c_str());
}
- /*
- oper: the nick of the oper performing the kline
- target.server: the server(s) this kline is destined for
- duration: the duration if a tkline, 0 if permanent.
- user: the 'user' portion of the kline
- host: the 'host' portion of the kline
- reason: the reason for the kline.
- */
-
- void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ void SendAkill(Akill *ak)
{
BotInfo *bi = findbot(Config.s_OperServ);
- send_cmd(bi ? bi->uid : Config.s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason);
+ send_cmd(bi ? bi->uid : Config.s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(ak->expires - time(NULL)), ak->user, ak->host, ak->reason);
}
- void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ void SendSVSKillInternal(BotInfo *source, User *user, const char *buf)
{
- BotInfo *bi = findbot(source);
- User *u = find_byuid(user);
- send_cmd(bi ? bi->uid : source, "KILL %s :%s", u ? u->GetUID().c_str(): user, buf);
+ send_cmd(source ? source->uid : TS6SID, "KILL %s :%s", user->GetUID().c_str(), buf);
}
void SendSVSMode(User *u, int ac, const char **av)
@@ -291,16 +274,15 @@ class RatboxProto : public IRCDTS6Proto
send_cmd(TS6SID, "SVSMODE %s %s", u->nick, buf);
}
- void SendKickInternal(BotInfo *bi, const char *chan, const char *user, const char *buf)
+ void SendKickInternal(BotInfo *bi, Channel *chan, User *user, const char *buf)
{
- User *u = finduser(user);
- if (buf) send_cmd(bi->uid, "KICK %s %s :%s", chan, u ? u->GetUID().c_str() : user, buf);
- else send_cmd(bi->uid, "KICK %s %s", chan, u ? u->GetUID().c_str() : user);
+ if (buf) send_cmd(bi->uid, "KICK %s %s :%s", chan->name, user->GetUID().c_str(), buf);
+ else send_cmd(bi->uid, "KICK %s %s", chan->name, user->GetUID().c_str());
}
- void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const char *buf)
{
- send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
+ send_cmd(NULL, "NOTICE @%s :%s", dest->name, buf);
}
/* QUIT */
@@ -334,9 +316,9 @@ class RatboxProto : public IRCDTS6Proto
return 1;
}
- void SendTopic(BotInfo *bi, const char *chan, const char *whosetit, const char *topic, time_t when)
+ void SendTopic(BotInfo *bi, Channel *c, const char *whosetit, const char *topic)
{
- send_cmd(bi->uid, "TOPIC %s :%s", chan, topic);
+ send_cmd(bi->uid, "TOPIC %s :%s", c->name, topic);
}
void SetAutoIdentificationToken(User *u)
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index 35eedfbb0..a859582b2 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -174,14 +174,14 @@ class UnrealIRCdProto : public IRCDProto
send_cmd(NULL, "f %s %s", server, set ? "+" : "-");
}
- void SendAkillDel(const char *user, const char *host)
+ void SendAkillDel(Akill *ak)
{
- send_cmd(NULL, "BD - G %s %s %s", user, host, Config.s_OperServ);
+ send_cmd(NULL, "BD - G %s %s %s", ak->user, ak->host, Config.s_OperServ);
}
- void SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when)
+ void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic)
{
- send_cmd(whosets->nick, ") %s %s %lu :%s", chan, whosetit, static_cast<unsigned long>(when), topic);
+ send_cmd(whosets->nick, ") %s %s %lu :%s", c->name, whosetit, static_cast<unsigned long>(c->topic_time), topic);
}
void SendVhostDel(User *u)
@@ -191,24 +191,17 @@ class UnrealIRCdProto : public IRCDProto
u->SetMode(UMODE_CLOAK);
}
- void SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
+ void SendAkill(Akill *ak)
{
// Calculate the time left before this would expire, capping it at 2 days
- time_t timeleft = expires - time(NULL);
+ time_t timeleft = ak->expires - time(NULL);
if (timeleft > 172800) timeleft = 172800;
- send_cmd(NULL, "BD + G %s %s %s %ld %ld :%s", user, host, who, static_cast<long>(time(NULL) + timeleft), static_cast<long>(when), reason);
+ send_cmd(NULL, "BD + G %s %s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL) + timeleft), static_cast<long>(ak->expires), ak->reason);
}
- /*
- ** svskill
- ** parv[0] = servername
- ** parv[1] = client
- ** parv[2] = kill message
- */
- void SendSVSKillInternal(const char *source, const char *user, const char *buf)
+ void SendSVSKillInternal(BotInfo *source, User *user, const char *buf)
{
- if (!source || !user || !buf) return;
- send_cmd(source, "h %s :%s", user, buf);
+ send_cmd(source ? source->nick : Config.ServerName, "h %s :%s", user->nick, buf);
}
/*
@@ -246,16 +239,16 @@ class UnrealIRCdProto : public IRCDProto
SendSQLine(nick, "Reserved for services");
}
- void SendKickInternal(BotInfo *source, const char *chan, const char *user, const char *buf)
+ void SendKickInternal(BotInfo *source, Channel *chan, User *user, const char *buf)
{
- if (buf) send_cmd(source->nick, "H %s %s :%s", chan, user, buf);
- else send_cmd(source->nick, "H %s %s", chan, user);
+ if (buf) send_cmd(source->nick, "H %s %s :%s", chan->name, user->nick, buf);
+ else send_cmd(source->nick, "H %s %s", chan->name, user->nick);
}
- void SendNoticeChanopsInternal(BotInfo *source, const char *dest, const char *buf)
+ void SendNoticeChanopsInternal(BotInfo *source, Channel *dest, const char *buf)
{
if (!buf) return;
- send_cmd(source->nick, "B @%s :%s", dest, buf);
+ send_cmd(source->nick, "B @%s :%s", dest->name, buf);
}
/* SERVER name hop descript */
@@ -321,11 +314,10 @@ class UnrealIRCdProto : public IRCDProto
/* Functions that use serval cmd functions */
- void SendVhost(const char *nick, const char *vIdent, const char *vhost)
+ void SendVhost(User *u, const char *vIdent, const char *vhost)
{
- if (!nick) return;
- if (vIdent) unreal_cmd_chgident(nick, vIdent);
- unreal_cmd_chghost(nick, vhost);
+ if (vIdent) unreal_cmd_chgident(u->nick, vIdent);
+ unreal_cmd_chghost(u->nick, vhost);
}
void SendConnect()
@@ -356,48 +348,48 @@ class UnrealIRCdProto : public IRCDProto
/*
* SVSNLINE - :realname mask
*/
- void SendSGLineDel(const char *mask)
+ void SendSGLineDel(SXLine *sx)
{
- send_cmd(NULL, "BR - :%s", mask);
+ send_cmd(NULL, "BR - :%s", sx->mask);
}
/* UNSZLINE */
- void SendSZLineDel(const char *mask)
+ void SendSZLineDel(SXLine *sx)
{
- send_cmd(NULL, "BD - Z * %s %s", mask, Config.s_OperServ);
+ send_cmd(NULL, "BD - Z * %s %s", sx->mask, Config.s_OperServ);
}
/* SZLINE */
- void SendSZLine(const char *mask, const char *reason, const char *whom)
+ void SendSZLine(SXLine *sx)
{
- send_cmd(NULL, "BD + Z * %s %s %ld %ld :%s", mask, whom, static_cast<long>(time(NULL) + 172800), static_cast<long>(time(NULL)), reason);
+ send_cmd(NULL, "BD + Z * %s %s %ld %ld :%s", sx->mask, sx->by, static_cast<long>(time(NULL) + 172800), static_cast<long>(time(NULL)), sx->reason);
}
/* SGLINE */
/*
* SVSNLINE + reason_where_is_space :realname mask with spaces
*/
- void SendSGLine(const char *mask, const char *reason)
+ void SendSGLine(SXLine *sx)
{
char edited_reason[BUFSIZE];
- strlcpy(edited_reason, reason, BUFSIZE);
+ strlcpy(edited_reason, sx->reason, BUFSIZE);
strnrepl(edited_reason, BUFSIZE, " ", "_");
- send_cmd(NULL, "BR + %s :%s", edited_reason, mask);
+ send_cmd(NULL, "BR + %s :%s", edited_reason, sx->mask);
}
/* SVSMODE -b */
- void SendBanDel(const char *name, const char *nick)
+ void SendBanDel(Channel *c, const char *nick)
{
- SendSVSModeChan(name, "-b", nick);
+ SendSVSModeChan(c, "-b", nick);
}
/* SVSMODE channel modes */
- void SendSVSModeChan(const char *name, const char *mode, const char *nick)
+ void SendSVSModeChan(Channel *c, const char *mode, const char *nick)
{
- if (nick) send_cmd(Config.ServerName, "n %s %s %s", name, mode, nick);
- else send_cmd(Config.ServerName, "n %s %s", name, mode);
+ if (nick) send_cmd(Config.ServerName, "n %s %s %s", c->name, mode, nick);
+ else send_cmd(Config.ServerName, "n %s %s", c->name, mode);
}
/* svsjoin
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 8c806fc02..bd6ded545 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -91,7 +91,7 @@ ChannelInfo::~ChannelInfo()
if (this->c)
{
if (this->bi && this->c->usercount >= Config.BSMinUsers)
- ircdproto->SendPart(this->bi, this->c->name, NULL);
+ ircdproto->SendPart(this->bi, this->c, NULL);
this->c->ci = NULL;
}
diff --git a/src/send.c b/src/send.c
index d40110072..f79398f6f 100644
--- a/src/send.c
+++ b/src/send.c
@@ -99,9 +99,9 @@ void notice_server(char *source, Server * s, const char *fmt, ...)
vsnprintf(buf, BUFSIZE - 1, fmt, args);
if (Config.NSDefFlags.HasFlag(NI_MSG)) {
- ircdproto->SendGlobalPrivmsg(findbot(source), s->name, buf);
+ ircdproto->SendGlobalPrivmsg(findbot(source), s, buf);
} else {
- ircdproto->SendGlobalNotice(findbot(source), s->name, buf);
+ ircdproto->SendGlobalNotice(findbot(source), s, buf);
}
va_end(args);
}
diff --git a/src/servers.c b/src/servers.c
index 8b1dee85e..aeb58a966 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -458,7 +458,7 @@ void do_squit(const char *source, int ac, const char **av)
{
snprintf(buf, BUFSIZE, "Received SQUIT for juped server %s",
s->name);
- ircdproto->SendGlobops(Config.s_OperServ, buf);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), buf);
}
snprintf(buf, sizeof(buf), "%s %s", s->name,
diff --git a/src/sessions.c b/src/sessions.c
index 934e3bc3f..d2814e4e0 100644
--- a/src/sessions.c
+++ b/src/sessions.c
@@ -163,7 +163,7 @@ int add_session(const char *nick, const char *host, char *hostip)
add_akill(NULL, akillmask, Config.s_OperServ,
time(NULL) + Config.SessionAutoKillExpiry,
"Session limit exceeded");
- ircdproto->SendGlobops(Config.s_OperServ,
+ ircdproto->SendGlobops(findbot(Config.s_OperServ),
"Added a temporary AKILL for \2%s\2 due to excessive connections",
akillmask);
}
@@ -214,7 +214,7 @@ void del_session(const char *host)
if (!session) {
if (debug) {
- ircdproto->SendGlobops(Config.s_OperServ,
+ ircdproto->SendGlobops(findbot(Config.s_OperServ),
"WARNING: Tried to delete non-existant session: \2%s",
host);
alog("session: Tried to delete non-existant session: %s",
@@ -261,7 +261,7 @@ void expire_exceptions()
if (exceptions[i].expires == 0 || exceptions[i].expires > now)
continue;
if (Config.WallExceptionExpire)
- ircdproto->SendGlobops(Config.s_OperServ,
+ ircdproto->SendGlobops(findbot(Config.s_OperServ),
"Session limit exception for %s has expired.",
exceptions[i].mask);
delete [] exceptions[i].mask;
diff --git a/src/users.c b/src/users.c
index eee3fda49..81caf0de4 100644
--- a/src/users.c
+++ b/src/users.c
@@ -1241,7 +1241,7 @@ void UserSetInternalModes(User *user, int ac, const char **av)
{
++opcnt;
if (Config.WallOper)
- ircdproto->SendGlobops(Config.s_OperServ, "\2%s\2 is now an IRC operator.", user->nick);
+ ircdproto->SendGlobops(findbot(Config.s_OperServ), "\2%s\2 is now an IRC operator.", user->nick);
}
else
--opcnt;