summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/extern.h1
-rw-r--r--include/services.h21
-rw-r--r--src/core/bs_bot.c4
-rw-r--r--src/ircd.c12
-rw-r--r--src/nickserv.c4
-rw-r--r--src/protocol/charybdis.c2
-rw-r--r--src/protocol/charybdis.h2
-rw-r--r--src/protocol/ratbox.c2
-rw-r--r--src/protocol/ratbox.h2
9 files changed, 24 insertions, 26 deletions
diff --git a/include/extern.h b/include/extern.h
index 2179bd414..0de10f3cb 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -1129,7 +1129,6 @@ E void anope_SendPart(const char *nick, const char *chan, const char *fmt, ...);
E void anope_cmd_pass(const char *pass); /* PASS */
E void anope_SendPong(const char *servname, const char *who); /* PONG */
E void anope_cmd_protoctl(); /* PROTOCTL */
-E void anope_SendQuit(const char *source, const char *fmt, ...); /* QUIT */
E void anope_SendSGLine(const char *mask, const char *reason); /* SGLINE */
E void anope_SendSQLine(const char *mask, const char *reason); /* SQLINE */
E void anope_SendSZLine(const char *mask, const char *reason, const char *whom); /* SZLINE */
diff --git a/include/services.h b/include/services.h
index 9be7c6ad4..62dda29c4 100644
--- a/include/services.h
+++ b/include/services.h
@@ -1249,6 +1249,13 @@ class IRCDProto {
{
send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s :%s", dest, buf);
}
+ virtual void SendQuitInternal(const char *source, const char *buf)
+ {
+ if (buf)
+ send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT :%s", buf);
+ else
+ send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT");
+ }
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1362,12 +1369,16 @@ class IRCDProto {
send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest, msg);
}
virtual void SendBotOp(const char *, const char *) = 0;
- virtual void SendQuit(const char *source, const char *buf)
+ virtual void SendQuit(const char *source, const char *fmt, ...)
{
- if (buf)
- send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT :%s", buf);
- else
- send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT");
+ va_list args;
+ char buf[BUFSIZE] = "";
+ if (fmt) {
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ }
+ SendQuitInternal(source, buf);
}
virtual void SendPong(const char *servname, const char *who)
{
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c
index d15f00dc5..901b7af79 100644
--- a/src/core/bs_bot.c
+++ b/src/core/bs_bot.c
@@ -297,7 +297,7 @@ int do_bot(User * u)
anope_SendChangeBotNick(oldnick, bi->nick);
anope_SendSQLine(bi->nick, "Reserved for services");
} else {
- anope_SendQuit(oldnick, "Quit: Be right back");
+ ircdproto->SendQuit(oldnick, "Quit: Be right back");
ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real,
ircd->botserv_bot_mode);
@@ -320,7 +320,7 @@ int do_bot(User * u)
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, nick);
else {
send_event(EVENT_BOT_DEL, 1, bi->nick);
- anope_SendQuit(bi->nick,
+ ircdproto->SendQuit(bi->nick,
"Quit: Help! I'm being deleted by %s!",
u->nick);
if (ircd->sqline) {
diff --git a/src/ircd.c b/src/ircd.c
index 961c2aee1..818becd50 100644
--- a/src/ircd.c
+++ b/src/ircd.c
@@ -43,18 +43,6 @@ void anope_ProcessUsermodes(User *user, int ac, const char **av)
ircdproto->ProcessUsermodes(user, ac, av);
}
-void anope_SendQuit(const char *source, 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->SendQuit(source, buf);
-}
-
void anope_SendPong(const char *servname, const char *who)
{
ircdproto->SendPong(servname, who);
diff --git a/src/nickserv.c b/src/nickserv.c
index 0a8fec390..d064dd032 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -1576,10 +1576,10 @@ void release(NickAlias * na, int from_timeout)
if (UseSVSHOLD) {
anope_SendSVSHOLDDel(na->nick);
} else {
- anope_SendQuit(na->nick, NULL);
+ ircdproto->SendQuit(na->nick, NULL);
}
} else {
- anope_SendQuit(na->nick, NULL);
+ ircdproto->SendQuit(na->nick, NULL);
}
na->status &= ~NS_KILL_HELD;
}
diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c
index c36e18a25..89b79ee65 100644
--- a/src/protocol/charybdis.c
+++ b/src/protocol/charybdis.c
@@ -1036,7 +1036,7 @@ void CharybdisProto::SendBotOp(const char *nick, const char *chan)
}
/* QUIT */
-void CharybdisProto::SendQuit(const char *source, const char *buf)
+void CharybdisProto::SendQuitInternal(const char *source, const char *buf)
{
BotInfo *bi = findbot(source);
if (buf) send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "QUIT :%s", buf);
diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h
index ac41d22a2..9098c7ef9 100644
--- a/src/protocol/charybdis.h
+++ b/src/protocol/charybdis.h
@@ -51,6 +51,7 @@ class CharybdisProto : public IRCDTS6Proto {
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
void SendNoticeChanopsInternal(const char *, const char *, const char *);
+ void SendQuitInternal(const char *, const char *);
public:
void SendAkillDel(const char *, const char *);
void SendVhostDel(User *);
@@ -58,7 +59,6 @@ class CharybdisProto : public IRCDTS6Proto {
void SendSVSMode(User *, int, const char **);
void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *);
void SendBotOp(const char *, const char *);
- void SendQuit(const char *, const char *);
void SendPong(const char *, const char *);
void SendJoin(const char *, const char *, time_t);
void SendSQLineDel(const char *);
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c
index 717c71f92..8145d26c8 100644
--- a/src/protocol/ratbox.c
+++ b/src/protocol/ratbox.c
@@ -965,7 +965,7 @@ void RatboxProto::SendBotOp(const char *nick, const char *chan)
}
/* QUIT */
-void RatboxProto::SendQuit(const char *source, const char *buf)
+void RatboxProto::SendQuitInternal(const char *source, const char *buf)
{
Uid *ud = find_uid(source);
if (buf) send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "QUIT :%s", buf);
diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h
index 3a8a96e1e..f4f99dcb4 100644
--- a/src/protocol/ratbox.h
+++ b/src/protocol/ratbox.h
@@ -50,13 +50,13 @@ class RatboxProto : public IRCDTS6Proto {
void SendModeInternal(const char *, const char *, const char *);
void SendKickInternal(const char *, const char *, const char *, const char *);
void SendNoticeChanopsInternal(const char *, const char *, const char *);
+ void SendQuitInternal(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 SendBotOp(const char *, const char *);
- void SendQuit(const char *, const char *);
void SendPong(const char *, const char *);
void SendJoin(const char *, const char *, time_t);
void SendSQLineDel(const char *);