From 50db0bb6807382c78f67a77670ecccf8038207a6 Mon Sep 17 00:00:00 2001 From: "Naram Qashat cyberbotx@cyberbotx.com" Date: Thu, 2 Oct 2008 19:25:27 +0000 Subject: 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 --- include/extern.h | 1 - include/services.h | 21 ++++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'include') 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) { -- cgit