summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-02 19:25:27 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-02 19:25:27 +0000
commit50db0bb6807382c78f67a77670ecccf8038207a6 (patch)
treecb25b194d8b335919dce7655f2f2f1c2a0e71483 /include
parent877791d8b63ee88f4edf9bcd2261a6bbafcde8af (diff)
Replaced anope_SendQuit() with direct call to SendQuit() in IRCDProto class.
Added SendQuitInternal() to IRCDProto class, now SendQuit() is a stub to handle varargs. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1341 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/extern.h1
-rw-r--r--include/services.h21
2 files changed, 16 insertions, 6 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)
{