summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/extern.h2
-rw-r--r--include/services.h18
2 files changed, 15 insertions, 5 deletions
diff --git a/include/extern.h b/include/extern.h
index c7993688a..96ea8d52a 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -1110,7 +1110,6 @@ E int db_mysql_load_news(void);
E unsigned int mysql_rand(void);
#endif
-E void privmsg(char *source, char *dest, const char *fmt, ...);
E void notice(char *source, const char *dest, const char *fmt, ...);
/******************************************************************************/
@@ -1133,7 +1132,6 @@ E void anope_SendGlobalNotice(const char *source, const char *dest, const char *
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_SendPong(const char *servname, const char *who); /* PONG */
-E void anope_cmd_privmsg(const char *source, const char *dest, const char *fmt, ...); /* PRIVMSG */
E void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...); /* PRIVMSG */
E void anope_SendGlobalPrivmsg(const char *source, const char *dest, const char *msg); /* PRIVMSG */
E void anope_cmd_protoctl(); /* PROTOCTL */
diff --git a/include/services.h b/include/services.h
index 9cb3273ba..6a23d4162 100644
--- a/include/services.h
+++ b/include/services.h
@@ -1237,10 +1237,14 @@ class IRCDProto {
virtual void SendMessageInternal(BotInfo *bi, const char *dest, const char *buf)
{
if (NSDefFlags & NI_MSG)
- SendPrivmsg(bi, dest, buf);
+ SendPrivmsgInternal(bi, dest, buf);
else
SendNotice(bi, dest, buf);
}
+ virtual void SendPrivmsgInternal(BotInfo *bi, const char *dest, const char *buf)
+ {
+ send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s :%s", dest, buf);
+ }
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1310,9 +1314,17 @@ class IRCDProto {
{
send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :%s", dest, msg);
}
- virtual void SendPrivmsg(BotInfo *bi, const char *dest, const char *buf)
+ virtual void SendPrivmsg(const char *source, const char *dest, const char *fmt, ...)
{
- send_cmd(UseTS6 ? bi->uid : bi->nick, "PRIVMSG %s :%s", dest, buf);
+ va_list args;
+ char buf[BUFSIZE] = "";
+ if (fmt) {
+ va_start(args, fmt);
+ vsnprintf(buf, BUFSIZE - 1, fmt, args);
+ va_end(args);
+ }
+ BotInfo *bi = findbot(source);
+ SendPrivmsgInternal(bi, dest, buf);
}
virtual void SendGlobalNotice(const char *source, const char *dest, const char *msg)
{