diff options
| author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 19:11:32 +0000 |
|---|---|---|
| committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-02 19:11:32 +0000 |
| commit | d3f58dcd4f97589ddeddd665eedede29ad6baa28 (patch) | |
| tree | bb53cade468e006cb5f6dd263d124f6b66b345d4 /include | |
| parent | 552c4a47b18a3373b46512a00bfce360f30a5cea (diff) | |
Replaced notice() with direct call to SendMessage() in IRCDProto class.
Added SendNoticeInternal() function to IRCDProto class, now SendNotice() is a stub to handle varargs.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1336 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 96ea8d52a..1b6e930ab 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1110,8 +1110,6 @@ E int db_mysql_load_news(void); E unsigned int mysql_rand(void); #endif -E void notice(char *source, const char *dest, const char *fmt, ...); - /******************************************************************************/ E void anope_cmd_capab(); /* CAPAB */ diff --git a/include/services.h b/include/services.h index 6a23d4162..4b9af9c48 100644 --- a/include/services.h +++ b/include/services.h @@ -1239,7 +1239,11 @@ class IRCDProto { if (NSDefFlags & NI_MSG) SendPrivmsgInternal(bi, dest, buf); else - SendNotice(bi, dest, buf); + SendNoticeInternal(bi, dest, buf); + } + virtual void SendNoticeInternal(BotInfo *bi, const char *dest, const char *msg) + { + send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :%s", dest, msg); } virtual void SendPrivmsgInternal(BotInfo *bi, const char *dest, const char *buf) { @@ -1310,9 +1314,17 @@ class IRCDProto { BotInfo *bi = findbot(source); SendMessageInternal(bi, dest, buf); } - virtual void SendNotice(BotInfo *bi, const char *dest, const char *msg) + virtual void SendNotice(const char *source, const char *dest, const char *fmt, ...) { - send_cmd(UseTS6 ? bi->uid : bi->nick, "NOTICE %s :%s", dest, msg); + 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); + SendNoticeInternal(bi, dest, buf); } virtual void SendPrivmsg(const char *source, const char *dest, const char *fmt, ...) { |
