diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-03 22:47:49 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-03 22:47:49 +0000 |
commit | d3d0bf2d6187ad97b8a375ea2f20c2baa469023a (patch) | |
tree | 5a66399d97b8015b7a5f93625f4b77ffe349faa6 /src | |
parent | 68bb357a6182fdb7d0be929eacef186b4a4cee5e (diff) |
Fix notices going to nicks instead of UIDs depending on protocol
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1526 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/send.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/send.c b/src/send.c index 0d4c6d4e9..2d850fdc2 100644 --- a/src/send.c +++ b/src/send.c @@ -148,15 +148,16 @@ void notice_user(char *source, User * u, const char *fmt, ...) */ void notice_list(char *source, char *dest, char **text) { + User *u = finduser(dest); while (*text) { /* Have to kludge around an ircII bug here: if a notice includes * no text, it is ignored, so we replace blank lines by lines * with a single space. */ if (**text) { - ircdproto->SendNotice(findbot(source), dest, *text); + u->SendMessage(source, *text); } else { - ircdproto->SendNotice(findbot(source), dest, " "); + u->SendMessage(source, " "); } text++; } @@ -195,18 +196,8 @@ void notice_lang(const char *source, User * dest, int message, ...) s += strcspn(s, "\n"); if (*s) *s++ = 0; - /* Send privmsg instead of notice if: - * - UsePrivmsg is enabled - * - The user is not registered and NSDefMsg is enabled - * - The user is registered and has set /ns set msg on - */ - if (UsePrivmsg && ((!dest->na && (NSDefFlags & NI_MSG)) - || (dest->na - && (dest->na->nc->flags & NI_MSG)))) { - ircdproto->SendPrivmsg(findbot(source), dest->nick, *t ? t : " "); - } else { - ircdproto->SendNotice(findbot(source), dest->nick, *t ? t : " "); - } + + dest->SendMessage(source, *t ? t : " "); } va_end(args); } @@ -251,18 +242,8 @@ 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 privmsg instead of notice if: - * - UsePrivmsg is enabled - * - The user is not registered and NSDefMsg is enabled - * - The user is registered and has set /ns set msg on - */ - if (UsePrivmsg && ((!dest->na && (NSDefFlags & NI_MSG)) - || (dest->na - && (dest->na->nc->flags & NI_MSG)))) { - ircdproto->SendPrivmsg(findbot(source), dest->nick, *outbuf ? outbuf : " "); - } else { - ircdproto->SendNotice(findbot(source), dest->nick, *outbuf ? outbuf : " "); - } + + dest->SendMessage(source, *outbuf ? outbuf : " "); } va_end(args); } |