From d3f58dcd4f97589ddeddd665eedede29ad6baa28 Mon Sep 17 00:00:00 2001 From: "Naram Qashat cyberbotx@cyberbotx.com" Date: Thu, 2 Oct 2008 19:11:32 +0000 Subject: 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 --- include/extern.h | 2 -- include/services.h | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'include') 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, ...) { -- cgit