diff options
author | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-08-23 18:36:58 +0000 |
---|---|---|
committer | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-08-23 18:36:58 +0000 |
commit | 61a23cd017465cd2bff5f037cf54e051a6318b37 (patch) | |
tree | 5827cad42b833c88be5783d457ffb03b00c785bf /src/send.c | |
parent | 26ea4bc11b4e07bbeb95031f2337ff695f83cc16 (diff) |
BUILD : 1.7.5 (327) BUGS : none NOTES : Merged anope-capab into main trunk...
git-svn-id: svn://svn.anope.org/anope/trunk@327 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@203 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 118 |
1 files changed, 37 insertions, 81 deletions
diff --git a/src/send.c b/src/send.c index a0284323a..ec7bc66ee 100644 --- a/src/send.c +++ b/src/send.c @@ -46,27 +46,7 @@ void vsend_cmd(const char *source, const char *fmt, va_list args) /*************************************************************************/ -/* Send out a WALLOPS (a GLOBOPS on ircd.dal). */ - -void wallops(const char *source, const char *fmt, ...) -{ - va_list args; - char buf[BUFSIZE]; - - va_start(args, fmt); - - vsnprintf(buf, sizeof(buf), fmt, args); -#ifdef IRC_HYBRID - send_cmd(source ? source : ServerName, "WALLOPS :%s", buf); -#else - send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); -#endif -} - -/*************************************************************************/ - -/* Send a NOTICE from the given source to the given nick. */ -void notice(const char *source, const char *dest, const char *fmt, ...) +void notice_server(char *source, Server * s, char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -74,32 +54,16 @@ void notice(const char *source, const char *dest, const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); - send_cmd(source, "%s %s :%s", (UsePrivmsg ? "PRIVMSG" : "NOTICE"), - dest, buf); -} - -/*************************************************************************/ - -void notice_server(const char *source, Server * s, const char *fmt, ...) -{ - va_list args; - char buf[BUFSIZE]; - - va_start(args, fmt); - - vsnprintf(buf, sizeof(buf), fmt, args); -#ifdef IRC_HYBRID - send_cmd(source, "%s $$%s :%s", (UsePrivmsg ? "PRIVMSG" : "NOTICE"), - s->name, buf); -#else - send_cmd(source, "%s $%s :%s", (UsePrivmsg ? "PRIVMSG" : "NOTICE"), - s->name, buf); -#endif + if (UsePrivmsg) { + anope_cmd_serv_privmsg(source, s->name, buf); + } else { + anope_cmd_serv_notice(source, s->name, buf); + } } /*************************************************************************/ -void notice_user(const char *source, User * u, const char *fmt, ...) +void notice_user(char *source, User * u, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -107,15 +71,17 @@ void notice_user(const char *source, User * u, const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); - send_cmd(source, "%s %s :%s", - (UsePrivmsg && (!u->na || (u->na->nc->flags & NI_MSG)) ? - "PRIVMSG" : "NOTICE"), u->nick, buf); + if (UsePrivmsg && (!u->na || (u->na->nc->flags & NI_MSG))) { + anope_cmd_privmsg2(source, u->nick, buf); + } else { + anope_cmd_notice2(source, u->nick, buf); + } } /*************************************************************************/ /* Send a NULL-terminated array of text as NOTICEs. */ -void notice_list(const char *source, const char *dest, const char **text) +void notice_list(char *source, char *dest, char **text) { while (*text) { /* Have to kludge around an ircII bug here: if a notice includes @@ -123,9 +89,9 @@ void notice_list(const char *source, const char *dest, const char **text) * with a single space. */ if (**text) - notice(source, dest, *text); + anope_cmd_notice2(source, dest, *text); else - notice(source, dest, " "); + anope_cmd_notice2(source, dest, " "); text++; } } @@ -133,7 +99,7 @@ void notice_list(const char *source, const char *dest, const char **text) /*************************************************************************/ /* Send a message in the user's selected language to the user using NOTICE. */ -void notice_lang(const char *source, User * dest, int message, ...) +void notice_lang(char *source, User * dest, int message, ...) { va_list args; char buf[4096]; /* because messages can be really big */ @@ -153,12 +119,11 @@ void notice_lang(const char *source, User * dest, int message, ...) s += strcspn(s, "\n"); if (*s) *s++ = 0; - send_cmd(source, "%s %s :%s", (UsePrivmsg - && (!dest->na || (dest->na->nc-> - flags & - NI_MSG)) ? - "PRIVMSG" : "NOTICE"), - dest->nick, *t ? t : " "); + if (UsePrivmsg && (!dest->na || (dest->na->nc->flags & NI_MSG))) { + anope_cmd_privmsg2(source, dest->nick, *t ? t : " "); + } else { + anope_cmd_notice2(source, dest->nick, *t ? t : " "); + } } } @@ -168,7 +133,7 @@ void notice_lang(const char *source, User * dest, int message, ...) * to simplify letting help messages display the name of the pseudoclient * that's sending them. */ -void notice_help(const char *source, User * dest, int message, ...) +void notice_help(char *source, User * dest, int message, ...) { va_list args; char buf[4096], buf2[4096], outbuf[BUFSIZE]; @@ -195,19 +160,18 @@ void notice_help(const char *source, User * dest, int message, ...) *s++ = 0; strscpy(outbuf, t, sizeof(outbuf)); strnrepl(outbuf, sizeof(outbuf), "\1\1", source); - send_cmd(source, "%s %s :%s", - (UsePrivmsg - && (!dest->na - || (dest->na->nc-> - flags & NI_MSG)) ? "PRIVMSG" : "NOTICE"), - dest->nick, *outbuf ? outbuf : " "); + if (UsePrivmsg && (!dest->na || (dest->na->nc->flags & NI_MSG))) { + anope_cmd_privmsg2(source, dest->nick, *outbuf ? outbuf : " "); + } else { + anope_cmd_notice2(source, dest->nick, *outbuf ? outbuf : " "); + } } } /*************************************************************************/ -/* Send a PRIVMSG from the given source to the given nick. */ -void privmsg(const char *source, const char *dest, const char *fmt, ...) +/* Send a NOTICE from the given source to the given nick. */ +void notice(char *source, char *dest, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -215,13 +179,17 @@ void privmsg(const char *source, const char *dest, const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); - send_cmd(source, "PRIVMSG %s :%s", dest, buf); + if (UsePrivmsg) { + anope_cmd_privmsg2(source, dest, buf); + } else { + anope_cmd_notice2(source, dest, buf); + } } /*************************************************************************/ -/* Sends a MODE from the given source on the given nick */ -void send_mode(const char *source, const char *on, const char *fmt, ...) +/* Send a PRIVMSG from the given source to the given nick. */ +void privmsg(char *source, char *dest, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -229,17 +197,5 @@ void send_mode(const char *source, const char *on, const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); -#ifdef IRC_BAHAMUT - -/* Ultimate3 doesn't send TS Mode - doing so will cause modes not to send */ -/* btw - this is used by channel setting was well - TSL */ -#if !defined(IRC_ULTIMATE3) - if (uplink_capab & CAPAB_TSMODE) - send_cmd(source, "MODE %s 0 %s", on, buf); - else -#endif -#endif - send_cmd(source, "MODE %s %s", on, buf); + anope_cmd_privmsg2(source, dest, buf); } - -/*************************************************************************/ |