mirror of
https://github.com/anope/anope.git
synced 2026-07-09 11:03:11 +02:00
Added SendAction() function to IRCDProto class to replace use of anope_cmd_notice().
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1337 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -1130,7 +1130,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_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 */
|
||||
E void anope_SendQuit(const char *source, const char *fmt, ...); /* QUIT */
|
||||
|
||||
@@ -1326,6 +1326,21 @@ class IRCDProto {
|
||||
BotInfo *bi = findbot(source);
|
||||
SendNoticeInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendAction(const char *source, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "", actionbuf[BUFSIZE] = "";
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
else return;
|
||||
if (!*buf) return;
|
||||
snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s%c", 1, buf, 1);
|
||||
BotInfo *bi = findbot(source);
|
||||
SendPrivmsgInternal(bi, dest, actionbuf);
|
||||
}
|
||||
virtual void SendPrivmsg(const char *source, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ int do_act(User * u)
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
strnrepl(text, BUFSIZE, "\001", "");
|
||||
anope_cmd_action(ci->bi->nick, ci->name, "%s", text);
|
||||
ircdproto->SendAction(ci->bi->nick, ci->name, "%s", text);
|
||||
ci->bi->lastmsg = time(NULL);
|
||||
if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
|
||||
ircdproto->SendPrivmsg(ci->bi->nick, LogChannel, "ACT %s %s %s",
|
||||
|
||||
-29
@@ -43,35 +43,6 @@ void anope_ProcessUsermodes(User *user, int ac, const char **av)
|
||||
ircdproto->ProcessUsermodes(user, ac, av);
|
||||
}
|
||||
|
||||
void anope_cmd_message(const char *source, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
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);
|
||||
ircdproto->SendMessage(bi, dest, buf);
|
||||
}
|
||||
|
||||
void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "", actionbuf[BUFSIZE] = "";
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
else return;
|
||||
if (!*buf) return;
|
||||
snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s%c", 1, buf, 1);
|
||||
BotInfo *bi = findbot(source);
|
||||
ircdproto->SendPrivmsg(bi, dest, actionbuf);
|
||||
}
|
||||
|
||||
void anope_SendGlobalNotice(const char *source, const char *dest, const char *msg)
|
||||
{
|
||||
ircdproto->SendGlobalNotice(source, dest, msg);
|
||||
|
||||
Reference in New Issue
Block a user