From f3f1b97a1ab782a3419fe20ae06d3e3535a4ddae Mon Sep 17 00:00:00 2001 From: "Naram Qashat cyberbotx@cyberbotx.com" Date: Thu, 2 Oct 2008 20:35:07 +0000 Subject: Replaced anope_SendPart() with direct call to SendPart() in IRCDProto class. Added SendPartInternal() function to IRCDProto class, now SendPart() is a stub to handle varargs. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1346 5417fbe8-f217-4b02-8779-1006273d7864 --- include/extern.h | 1 - include/services.h | 22 +++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/extern.h b/include/extern.h index 376a144ec..0f1e8577f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1123,7 +1123,6 @@ E void anope_cmd_tmode(const char *source, const char *dest, const char *fmt, .. E void anope_SendBanDel(const char *name, const char *nick); /* MODE -b */ E void anope_cmd_netinfo(int ac, const char **av); /* NETINFO */ E void anope_SendChangeBotNick(const char *oldnick, const char *newnick); /* NICK */ -E void anope_SendPart(const char *nick, const char *chan, const char *fmt, ...); /* PART */ E void anope_cmd_pass(const char *pass); /* PASS */ E void anope_cmd_protoctl(); /* PROTOCTL */ E void anope_SendSGLine(const char *mask, const char *reason); /* SGLINE */ diff --git a/include/services.h b/include/services.h index 62dda29c4..6fc0cf8cf 100644 --- a/include/services.h +++ b/include/services.h @@ -1256,6 +1256,13 @@ class IRCDProto { else send_cmd(UseTS6 ? bi->uid : bi->nick, "QUIT"); } + virtual void SendPartInternal(const char *nick, const char *chan, const char *buf) + { + if (buf) + send_cmd(nick, "PART %s :%s", chan, buf); + else + send_cmd(nick, "PART %s", chan); + } public: virtual void SendSVSNOOP(const char *, int) { } virtual void SendAkillDel(const char *, const char *) = 0; @@ -1390,12 +1397,17 @@ class IRCDProto { { send_cmd(UseTS6 ? bi->uid : bi->nick, "INVITE %s %s", nick, chan); } - virtual void SendPart(const char *nick, const char *chan, const char *buf) + virtual void SendPart(const char *nick, const char *chan, const char *fmt, ...) { - if (buf) - send_cmd(nick, "PART %s :%s", chan, buf); - else - send_cmd(nick, "PART %s", chan); + if (fmt) { + va_list args; + char buf[BUFSIZE] = ""; + va_start(args, fmt); + vsnprintf(buf, BUFSIZE - 1, fmt, args); + va_end(args); + SendPartInternal(nick, chan, buf); + } + else SendPartInternal(nick, chan, NULL); } virtual void SendGlobops(const char *source, const char *buf) { -- cgit