diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/extern.h | 1 | ||||
| -rw-r--r-- | include/services.h | 21 |
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) { |
