diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-06-09 15:27:41 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-06-09 15:27:41 +0000 |
commit | 461af46f0e3ff11615813a36d696829b0a2a12f0 (patch) | |
tree | 6cadb39b422a30fda5a6b2e253510ee7a29d2bc1 /src/send.c | |
parent | 0bdd730f3cfb306f8d1b05bb215693677ecf04ba (diff) |
BUILD : 1.7.18 (1245) BUGS : 671 NOTES : NSDefKill can now only be enabled if UsePrivmsg is also enabled; NSDefKill is now used instead of UsePrivmsg to determine whether unregistered users receive PRIVMSGs or NOTICEs
git-svn-id: svn://svn.anope.org/anope/trunk@1245 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@964 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/send.c b/src/send.c index 1ea115518..0f5179de6 100644 --- a/src/send.c +++ b/src/send.c @@ -97,7 +97,7 @@ void notice_server(char *source, Server * s, char *fmt, ...) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { anope_cmd_serv_privmsg(source, s->name, buf); } else { anope_cmd_serv_notice(source, s->name, buf); @@ -131,7 +131,14 @@ void notice_user(char *source, User * u, const char *fmt, ...) return; } - if (UsePrivmsg && (!u->na || (u->na->nc->flags & NI_MSG))) { + /* 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 + && ((!u->na && (NSDefFlags & NI_MSG)) + || (u->na && (u->na->nc->flags & NI_MSG)))) { anope_cmd_privmsg2(source, u->nick, buf); } else { anope_cmd_notice2(source, u->nick, buf); @@ -196,7 +203,14 @@ void notice_lang(char *source, User * dest, int message, ...) s += strcspn(s, "\n"); if (*s) *s++ = 0; - if (UsePrivmsg && (!dest->na || (dest->na->nc->flags & NI_MSG))) { + /* 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)))) { anope_cmd_privmsg2(source, dest->nick, *t ? t : " "); } else { anope_cmd_notice2(source, dest->nick, *t ? t : " "); @@ -245,7 +259,14 @@ void notice_help(char *source, User * dest, int message, ...) *s++ = 0; strscpy(outbuf, t, sizeof(outbuf)); strnrepl(outbuf, sizeof(outbuf), "\1\1", source); - if (UsePrivmsg && (!dest->na || (dest->na->nc->flags & NI_MSG))) { + /* 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)))) { anope_cmd_privmsg2(source, dest->nick, *outbuf ? outbuf : " "); } else { anope_cmd_notice2(source, dest->nick, *outbuf ? outbuf : " "); @@ -279,7 +300,7 @@ void notice(char *source, char *dest, const char *fmt, ...) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { anope_cmd_privmsg2(source, dest, buf); } else { anope_cmd_notice2(source, dest, buf); |