summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/extern.h1
-rw-r--r--include/services.h22
2 files changed, 17 insertions, 6 deletions
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)
{