diff options
author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 19:06:00 +0000 |
---|---|---|
committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 19:06:00 +0000 |
commit | 552c4a47b18a3373b46512a00bfce360f30a5cea (patch) | |
tree | 3a458d3c53bfe78d63c28fe520b2dd83b9a0d11f /include | |
parent | 8001cc147dded5bb8acefe6cb93d6defb3f92562 (diff) |
Replaced anope_cmd_privmsg() and privmsg() with direct call to SendPrivmsg() in IRCDProto class.
Added SendPrivmsgInternal() function to IRCDProto class, now SendPrivmsg() is a stub to handle varargs.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1335 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r-- | include/extern.h | 2 | ||||
-rw-r--r-- | include/services.h | 18 |
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) { |