summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/extern.h1
-rw-r--r--include/services.h22
-rw-r--r--src/messages.c2
3 files changed, 18 insertions, 7 deletions
diff --git a/include/extern.h b/include/extern.h
index a6416bf80..200baa430 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -1129,7 +1129,6 @@ E void anope_SendBanDel(const char *name, const char *nick); /
E void anope_SendBotOp(const char *nick, const char *chan); /* MODE BotServ */
E void anope_cmd_netinfo(int ac, const char **av); /* NETINFO */
E void anope_SendChangeBotNick(const char *oldnick, const char *newnick); /* NICK */
-E void anope_cmd_message(const char *source, const char *dest, const char *fmt, ...); /* NOTICE */
E void anope_cmd_notice(const char *source, const char *dest, const char *msg); /* NOTICE */
E void anope_SendGlobalNotice(const char *source, const char *dest, const char *msg); /* NOTICE */
E void anope_SendPart(const char *nick, const char *chan, const char *fmt, ...); /* PART */
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)
{
diff --git a/src/messages.c b/src/messages.c
index e6033627e..87d466562 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -120,7 +120,7 @@ int m_privmsg(const char *source, const char *receiver, const char *msg)
if (!u) {
alog("%s: user record for %s not found", msg, source);
- anope_cmd_message(receiver, source,
+ ircdproto->SendMessage(receiver, source,
getstring(NULL, USER_RECORD_NOT_FOUND));
return MOD_CONT;
}