1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 03:03:14 +02:00

Replaced anope_SendKick() with direct call to SendKick() in IRCDProto class.

Also added SendKickInternal() function to IRCDProto class, now SendKick() is a stub to handle varargs.


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1331 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Naram Qashat cyberbotx@cyberbotx.com
2008-10-02 18:37:32 +00:00
parent 984779a0f3
commit 765f561952
24 changed files with 59 additions and 61 deletions
-1
View File
@@ -1124,7 +1124,6 @@ E void anope_cmd_ea(); /* EA */
E void anope_SendGlobops(const char *source, const char *fmt, ...); /* GLOBOPS */
E void anope_SendInvite(const char *source, const char *chan, const char *nick); /* INVITE */
E void anope_SendJoin(const char *user, const char *channel, time_t chantime); /* JOIN */
E void anope_SendKick(const char *source, const char *chan, const char *user, const char *fmt, ...); /* KICK */
E void anope_cmd_tmode(const char *source, const char *dest, const char *fmt, ...); /* TMODE */
E void anope_SendBanDel(const char *name, const char *nick); /* MODE -b */
E void anope_SendBotOp(const char *nick, const char *chan); /* MODE BotServ */
+12 -1
View File
@@ -1232,6 +1232,7 @@ class IRCDProto;
class IRCDProto {
virtual void SendSVSKillInternal(const char *, const char *, const char *) = 0;
virtual void SendModeInternal(const char *, const char *, const char *) = 0;
virtual void SendKickInternal(const char *, const char *, const char *, const char *) = 0;
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1263,7 +1264,17 @@ class IRCDProto {
SendModeInternal(source, dest, buf);
}
virtual void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *) = 0;
virtual void SendKick(const char *, const char *, const char *, const char *) = 0;
virtual void SendKick(const char *source, const char *chan, const char *user, const char *fmt, ...)
{
va_list args;
char buf[BUFSIZE] = "";
if (fmt) {
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
}
SendKickInternal(source, chan, user, buf);
}
virtual void SendNoticeChanops(const char *, const char *, const char *) = 0;
virtual void SendMessage(BotInfo *bi, const char *dest, const char *buf)
{
+1 -1
View File
@@ -106,7 +106,7 @@ void sqline(char *mask, char *reason)
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason;
anope_SendKick(s_OperServ, av[0], av[1],
ircdproto->SendKick(s_OperServ, av[0], av[1],
"Q-Lined: %s", av[2]);
do_kick(s_ChanServ, 3, av);
}
+5 -5
View File
@@ -822,7 +822,7 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
av[0] = ci->name;
av[1] = u->nick;
av[2] = buf;
anope_SendKick(ci->bi->nick, av[0], av[1], "%s", av[2]);
ircdproto->SendKick(ci->bi->nick, av[0], av[1], "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
send_event(EVENT_BOT_KICK, 3, u->nick, ci->name, buf);
}
@@ -898,10 +898,10 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(requester, ci, CA_SIGNKICK)))
anope_SendKick(ci->bi->nick, kav[0], kav[1], "%s (%s)", kav[2],
ircdproto->SendKick(ci->bi->nick, kav[0], kav[1], "%s (%s)", kav[2],
requester->nick);
else
anope_SendKick(ci->bi->nick, kav[0], kav[1], "%s", kav[2]);
ircdproto->SendKick(ci->bi->nick, kav[0], kav[1], "%s", kav[2]);
do_kick(ci->bi->nick, 3, kav);
send_event(EVENT_BOT_KICK, 3, kav[1], kav[0], kav[2]);
@@ -946,10 +946,10 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(requester, ci, CA_SIGNKICK)))
anope_SendKick(ci->bi->nick, av[0], av[1], "%s (%s)", av[2],
ircdproto->SendKick(ci->bi->nick, av[0], av[1], "%s (%s)", av[2],
requester->nick);
else
anope_SendKick(ci->bi->nick, av[0], av[1], "%s", av[2]);
ircdproto->SendKick(ci->bi->nick, av[0], av[1], "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
send_event(EVENT_BOT_KICK, 3, av[1], av[0], av[2]);
}
+4 -4
View File
@@ -872,7 +872,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
anope_SendKick(s_OperServ, av[1], s, "Q-Lined");
ircdproto->SendKick(s_OperServ, av[1], s, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
@@ -957,7 +957,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
anope_SendKick(s_OperServ, av[1], s, "Q-Lined");
ircdproto->SendKick(s_OperServ, av[1], s, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
@@ -1032,7 +1032,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
anope_SendKick(s_OperServ, av[1], s, "Q-Lined");
ircdproto->SendKick(s_OperServ, av[1], s, "Q-Lined");
} else {
if (!check_kick(user, av[1], ts)) {
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
@@ -1093,7 +1093,7 @@ void do_sjoin(const char *source, int ac, const char **av)
}
if (is_sqlined && !is_oper(user)) {
anope_SendKick(s_OperServ, av[1], user->nick, "Q-Lined");
ircdproto->SendKick(s_OperServ, av[1], user->nick, "Q-Lined");
} else {
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START, user->nick,
av[1]);
+1 -1
View File
@@ -1381,7 +1381,7 @@ int check_kick(User * user, const char *chan, time_t chants)
}
ircdproto->SendMode(whosends(ci), chan, "+b %s", mask);
anope_SendKick(whosends(ci), chan, user->nick, "%s", reason);
ircdproto->SendKick(whosends(ci), chan, user->nick, "%s", reason);
return 1;
}
+4 -4
View File
@@ -125,10 +125,10 @@ int do_ban(User * u)
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(u, ci, CA_SIGNKICK)))
anope_SendKick(whosends(ci), ci->name, u->nick,
ircdproto->SendKick(whosends(ci), ci->name, u->nick,
"%s (%s)", reason, u->nick);
else
anope_SendKick(whosends(ci), ci->name, u->nick, "%s",
ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s",
reason);
const char *kav[4];
@@ -185,10 +185,10 @@ int do_ban(User * u)
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(u, ci, CA_SIGNKICK)))
anope_SendKick(whosends(ci), ci->name, params, "%s (%s)",
ircdproto->SendKick(whosends(ci), ci->name, params, "%s (%s)",
reason, u->nick);
else
anope_SendKick(whosends(ci), ci->name, params, "%s", reason);
ircdproto->SendKick(whosends(ci), ci->name, params, "%s", reason);
const char *kav[4];
kav[0] = ci->name;
+1 -1
View File
@@ -358,7 +358,7 @@ int do_clear(User * u)
av[0] = sstrdup(chan);
av[1] = sstrdup(cu->user->nick);
av[2] = sstrdup(buf);
anope_SendKick(whosends(ci), av[0], av[1], av[2]);
ircdproto->SendKick(whosends(ci), av[0], av[1], av[2]);
do_kick(s_ChanServ, 3, av);
free((void *)av[2]);
free((void *)av[1]);
+3 -3
View File
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -112,7 +112,7 @@ int do_forbid(User * u)
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason ? reason : "CHAN_FORBID_REASON";
anope_SendKick(s_ChanServ, av[0], av[1], av[2]);
ircdproto->SendKick(s_ChanServ, av[0], av[1], av[2]);
do_kick(s_ChanServ, 3, av);
}
}
+6 -6
View File
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -96,10 +96,10 @@ int do_cs_kick(User * u)
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(u, ci, CA_SIGNKICK)))
anope_SendKick(whosends(ci), ci->name, u->nick,
ircdproto->SendKick(whosends(ci), ci->name, u->nick,
"%s (%s)", reason, u->nick);
else
anope_SendKick(whosends(ci), ci->name, u->nick, "%s",
ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s",
reason);
av[0] = ci->name;
av[1] = u->nick;
@@ -139,10 +139,10 @@ int do_cs_kick(User * u)
if ((ci->flags & CI_SIGNKICK)
|| ((ci->flags & CI_SIGNKICK_LEVEL)
&& !check_access(u, ci, CA_SIGNKICK)))
anope_SendKick(whosends(ci), ci->name, params, "%s (%s)",
ircdproto->SendKick(whosends(ci), ci->name, params, "%s (%s)",
reason, u->nick);
else
anope_SendKick(whosends(ci), ci->name, params, "%s", reason);
ircdproto->SendKick(whosends(ci), ci->name, params, "%s", reason);
av[0] = ci->name;
av[1] = params;
av[2] = reason;
+5 -5
View File
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -92,7 +92,7 @@ int do_suspend(User * u)
notice_lang(s_ChanServ, u, CHAN_UNSUSPEND_ERROR);
return MOD_CONT;
}
/* Only SUSPEND existing channels, otherwise use FORBID (bug #54) */
if ((ci = cs_findchan(chan)) == NULL) {
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
@@ -127,7 +127,7 @@ int do_suspend(User * u)
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason ? reason : "CHAN_SUSPEND_REASON";
anope_SendKick(s_ChanServ, av[0], av[1], av[2]);
ircdproto->SendKick(s_ChanServ, av[0], av[1], av[2]);
do_kick(s_ChanServ, 3, av);
}
}
@@ -173,7 +173,7 @@ int do_unsuspend(User * u)
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
return MOD_CONT;
}
if (!(ci->flags & CI_SUSPENDED))
{
notice_lang(s_ChanServ, u, CHAN_UNSUSPEND_FAILED, chan);
+3 -3
View File
@@ -6,8 +6,8 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -85,7 +85,7 @@ int do_os_kick(User * u)
notice_lang(s_OperServ, u, OPER_BOUNCY_MODES_U_LINE);
return MOD_CONT;
}
anope_SendKick(s_OperServ, chan, nick, "%s (%s)", u->nick, s);
ircdproto->SendKick(s_OperServ, chan, nick, "%s (%s)", u->nick, s);
if (WallOSKick)
anope_SendGlobops(s_OperServ, "%s used KICK on %s/%s", u->nick,
nick, chan);
-12
View File
@@ -43,18 +43,6 @@ void anope_ProcessUsermodes(User *user, int ac, const char **av)
ircdproto->ProcessUsermodes(user, ac, av);
}
void anope_SendKick(const char *source, const char *chan, const char *user, const char *fmt, ...)
{
va_list args;
char buf[BUFSIZE] = "";
if (fmt) {
va_start(args, fmt);
vsnprintf(buf, BUFSIZE - 1, fmt, args);
va_end(args);
}
ircdproto->SendKick(source, chan, user, buf);
}
void anope_SendNoticeChanops(const char *source, const char *dest, const char *fmt, ...)
{
va_list args;
+2 -2
View File
@@ -122,7 +122,7 @@ void do_enforce_restricted(Channel * c)
reason = getstring(u->na, CHAN_NOT_ALLOWED_TO_JOIN);
ircdproto->SendMode(whosends(ci), ci->name, "+b %s %lu", mask,
time(NULL));
anope_SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
av[0] = ci->name;
av[1] = u->nick;
av[2] = reason;
@@ -162,7 +162,7 @@ void do_enforce_cmode_R(Channel * c)
|| !(c->mode & cbm->flag))
ircdproto->SendMode(whosends(ci), ci->name, "+b %s %lu", mask,
time(NULL));
anope_SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s", reason);
av[0] = ci->name;
av[1] = u->nick;
av[2] = reason;
+1 -1
View File
@@ -878,7 +878,7 @@ void BahamutIRCdProto::SendNoticeChanops(const char *source, const char *dest, c
send_cmd(NULL, "NOTICE @%s :%s", dest, buf);
}
void BahamutIRCdProto::SendKick(const char *source, const char *chan, const char *user, const char *buf)
void BahamutIRCdProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf)
{
if (buf) send_cmd(source, "KICK %s %s :%s", chan, user, buf);
else send_cmd(source, "KICK %s %s", chan, user);
+2 -2
View File
@@ -60,7 +60,8 @@
class BahamutIRCdProto : public IRCDProto {
void SendSVSKillInternal(const char *, const char *, const char *);
void SendMode(const char *, const char *, const char *);
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
public:
void SendSVSNOOP(const char *, int);
void SendAkillDel(const char *, const char *);
@@ -69,7 +70,6 @@ class BahamutIRCdProto : public IRCDProto {
void SendSVSMode(User *, int, const char **);
void SendGuestNick(const char *, const char *, const char *, const char *, const char *);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendKick(const char *, const char *, const char *, const char *);
void SendNoticeChanops(const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
void SendJoin(const char *, const char *, time_t);
+1 -1
View File
@@ -1011,7 +1011,7 @@ void charybdis_cmd_tmode(const char *source, const char *dest, const char *fmt,
send_cmd(NULL, "MODE %s %s", dest, buf);
}
void CharybdisProto::SendKick(const char *source, const char *chan, const char *user, const char *buf)
void CharybdisProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf)
{
BotInfo *bi = findbot(source);
User *u = finduser(user);
+2 -2
View File
@@ -48,14 +48,14 @@
class CharybdisProto : public IRCDTS6Proto {
void SendSVSKillInternal(const char *, const char *, const char *);
void SendMode(const char *, const char *, const char *);
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
public:
void SendAkillDel(const char *, const char *);
void SendVhostDel(User *);
void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *);
void SendSVSMode(User *, int, const char **);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendKick(const char *, const char *, const char *, const char *);
void SendNoticeChanops(const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
void SendQuit(const char *, const char *);
+1 -1
View File
@@ -733,7 +733,7 @@ void InspIRCdProto::SendClientIntroduction(const char *nick, const char *user, c
send_cmd(nick, "OPERTYPE Service");
}
void InspIRCdProto::SendKick(const char *source, const char *chan, const char *user, const char *buf)
void InspIRCdProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf)
{
if (buf) send_cmd(source, "KICK %s %s :%s", chan, user, buf);
else send_cmd(source, "KICK %s %s :%s", chan, user, user);
+1 -1
View File
@@ -54,6 +54,7 @@
class InspIRCdProto : public IRCDProto {
void SendSVSKillInternal(const char *, const char *, const char *);
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
public:
void SendAkillDel(const char *, const char *);
void SendTopic(BotInfo *, const char *, const char *, const char *, time_t);
@@ -62,7 +63,6 @@ class InspIRCdProto : public IRCDProto {
void SendSVSMode(User *, int, const char **);
void SendGuestNick(const char *, const char *, const char *, const char *, const char *);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendKick(const char *, const char *, const char *, const char *);
void SendNoticeChanops(const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
void SendJoin(const char *, const char *, time_t);
+1 -1
View File
@@ -941,7 +941,7 @@ void ratbox_cmd_tmode(const char *source, const char *dest, const char *fmt, ...
send_cmd(NULL, "MODE %s %s", dest, buf);
}
void RatboxProto::SendKick(const char *source, const char *chan, const char *user, const char *buf)
void RatboxProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf)
{
Uid *ud = find_uid(source);
User *u = finduser(user);
+1 -1
View File
@@ -48,12 +48,12 @@
class RatboxProto : public IRCDTS6Proto {
void SendSVSKillInternal(const char *, const char *, const char *);
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
public:
void SendAkillDel(const char *, const char *);
void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *);
void SendSVSMode(User *, int, const char **);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendKick(const char *, const char *, const char *, const char *);
void SendNoticeChanops(const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
void SendQuit(const char *, const char *);
+1 -1
View File
@@ -556,7 +556,7 @@ void UnrealIRCdProto::SendClientIntroduction(const char *nick, const char *user,
SendSQLine(nick, "Reserved for services");
}
void UnrealIRCdProto::SendKick(const char *source, const char *chan, const char *user, const char *buf)
void UnrealIRCdProto::SendKickInternal(const char *source, const char *chan, const char *user, const char *buf)
{
if (buf) send_cmd(source, "%s %s %s :%s", send_token("KICK", "H"), chan, user, buf);
else send_cmd(source, "%s %s %s", send_token("KICK", "H"), chan, user);
+1 -1
View File
@@ -83,6 +83,7 @@
class UnrealIRCdProto : public IRCDProto {
void SendSVSKillInternal(const char *, const char *, const char *);
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
public:
void SendSVSNOOP(const char *, int);
void SendAkillDel(const char *, const char *);
@@ -92,7 +93,6 @@ class UnrealIRCdProto : public IRCDProto {
void SendSVSMode(User *, int, const char **);
void SendGuestNick(const char *, const char *, const char *, const char *, const char *);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendKick(const char *, const char *, const char *, const char *);
void SendNoticeChanops(const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
void SendJoin(const char *, const char *, time_t);