summaryrefslogtreecommitdiff
path: root/include/services.h
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-02 18:50:20 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-02 18:50:20 +0000
commita22c4bf1daa18e11141a94ecd20dfd8af4944adb (patch)
tree1c26b4c7f7a6c32a62a711790d9da6dd58d5bc32 /include/services.h
parentc48429eb7515583de22bc8134493b3bfad2df0c4 (diff)
Replaced anope_cmd_message() with direct call to SendMessage() in IRCDProto class.
Also added SendMessageInternal() function to IRCDProto class, now SendMessage() is a stub to handle varargs. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1333 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/services.h')
-rw-r--r--include/services.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/services.h b/include/services.h
index 58c0570f8..9cb3273ba 100644
--- a/include/services.h
+++ b/include/services.h
@@ -1234,6 +1234,13 @@ class IRCDProto {
virtual void SendModeInternal(const char *, const char *, const char *) = 0;
virtual void SendKickInternal(const char *, const char *, const char *, const char *) = 0;
virtual void SendNoticeChanopsInternal(const char *, const char *, const char *) = 0;
+ virtual void SendMessageInternal(BotInfo *bi, const char *dest, const char *buf)
+ {
+ if (NSDefFlags & NI_MSG)
+ SendPrivmsg(bi, dest, buf);
+ else
+ SendNotice(bi, dest, buf);
+ }
public:
virtual void SendSVSNOOP(const char *, int) { }
virtual void SendAkillDel(const char *, const char *) = 0;
@@ -1287,12 +1294,17 @@ class IRCDProto {
}
SendNoticeChanopsInternal(source, dest, buf);
}
- virtual void SendMessage(BotInfo *bi, const char *dest, const char *buf)
+ virtual void SendMessage(const char *source, const char *dest, const char *fmt, ...)
{
- if (NSDefFlags & NI_MSG)
- SendPrivmsg(bi, dest, buf);
- else
- SendNotice(bi, 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);
+ SendMessageInternal(bi, dest, buf);
}
virtual void SendNotice(BotInfo *bi, const char *dest, const char *msg)
{