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 | |
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
-rw-r--r-- | Changes | 9 | ||||
-rw-r--r-- | data/example.conf | 10 | ||||
-rw-r--r-- | src/config.c | 8 | ||||
-rw-r--r-- | src/protocol/bahamut.c | 2 | ||||
-rw-r--r-- | src/protocol/charybdis.c | 2 | ||||
-rw-r--r-- | src/protocol/dreamforge.c | 2 | ||||
-rw-r--r-- | src/protocol/hybrid.c | 2 | ||||
-rw-r--r-- | src/protocol/inspircd10.c | 2 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 2 | ||||
-rw-r--r-- | src/protocol/plexus2.c | 2 | ||||
-rw-r--r-- | src/protocol/plexus3.c | 2 | ||||
-rw-r--r-- | src/protocol/ptlink.c | 2 | ||||
-rw-r--r-- | src/protocol/rageircd.c | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 2 | ||||
-rw-r--r-- | src/protocol/shadowircd.c | 2 | ||||
-rw-r--r-- | src/protocol/solidircd.c | 2 | ||||
-rw-r--r-- | src/protocol/ultimate2.c | 2 | ||||
-rw-r--r-- | src/protocol/ultimate3.c | 2 | ||||
-rw-r--r-- | src/protocol/unreal31.c | 2 | ||||
-rw-r--r-- | src/protocol/unreal32.c | 2 | ||||
-rw-r--r-- | src/protocol/viagra.c | 2 | ||||
-rw-r--r-- | src/send.c | 31 | ||||
-rw-r--r-- | version.log | 6 |
23 files changed, 67 insertions, 33 deletions
@@ -20,6 +20,11 @@ Anope Version S V N 03/18 F Password length checking in some cases was out. [ #00] 04/21 F DefCon did not force DefCon modes while in DefCon mode. [#661] 04/21 F Event ACCESS_DEL not sent on mass-deleted in cs_xop. [#706] +06/04 F prenick database was not backed up. [#713] +06/04 F Typo in SQL query in rdb.c [#719] +06/04 F remove_backups() did not check that s_Bot/HostServ != NULL. [ #00] +06/09 F NSDefMsg can now only be enabled when UsePrivmsg is enabled. [#671] +06/09 F NSDefMsg now controls send behaviour for unregistered users. [#671] Provided by Jan Milants <jan_renee@msn.com> - 2007 04/21 F Array count decremention in the ChanServ access lists. [#662] @@ -28,10 +33,6 @@ Provided by Jan Milants <jan_renee@msn.com> - 2007 Provided by Jilles Tjoelker <jilles+anope@stack.nl> - 2007 04/21 F Various Charybdis and TS6 related fixes. [#707] -06/04 F prenick database was not backed up [#713] -06/04 F Typo in SQL query in rdb.c [#719] -06/04 F remove_backups() did not check that s_Bot/HostServ != NULL [ #00] - Anope Version 1.7.18 -------------------- 12/09 A Ability to see if AutoOp is enabled in NickServ INFO displays. [#621] diff --git a/data/example.conf b/data/example.conf index 2589311d8..ceac50923 100644 --- a/data/example.conf +++ b/data/example.conf @@ -493,9 +493,9 @@ ForceForbidReason # UsePrivmsg [OPTIONAL] # -# This directive will make Services send PRIVMSGs to users instead of -# NOTICEs by default, and allow users to set how Services should -# communicate with them. +# This directive allows users to let Services send PRIVMSGs to them +# instead of NOTICEs. Also see NSDefMsg, which also toggles the default +# communication (PRIVMSG or NOTICE) to use for unregistered users. # # This is a feature that is against the IRC RFC and should be used # _only_ if absolutely necessary. @@ -730,6 +730,10 @@ NSForceEmail # # Note: Both NSDefKill and NSDefKillQuick must be specified for Quick to take effect. # +# NSDefMsg also controls the default setting for unregistered users. +# If NSDefMsg is enabled, unregistered users will receive PRIVMSGs +# instead of NOTICEs from Services. See UsePrivmsg for more information. +# # NOTE: If you do not enable any of these options, a default of # Secure, MemoSignon, and MemoReceive will be used, for backward # compatibility. If you really want no options enabled by default, use diff --git a/src/config.c b/src/config.c index b6728f0ca..76d571e7d 100644 --- a/src/config.c +++ b/src/config.c @@ -1109,8 +1109,12 @@ int read_config(int reload) NSDefFlags |= NI_SECURE; if (NSDefPrivate) NSDefFlags |= NI_PRIVATE; - if (NSDefMsg) - NSDefFlags |= NI_MSG; + if (NSDefMsg) { + if (!UsePrivmsg) + alog("NSDefMsg can only be used when UsePrivmsg is set - unsetting NSDefMsg"); + else + NSDefFlags |= NI_MSG; + } if (NSDefHideEmail) NSDefFlags |= NI_HIDE_EMAIL; if (NSDefHideUsermask) diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 7e55959ce..9f0d352cc 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -1052,7 +1052,7 @@ void bahamut_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { bahamut_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index b86955ed3..37c6a47cd 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -459,7 +459,7 @@ void charybdis_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { charybdis_cmd_privmsg2(source, dest, buf); } else { ud = find_uid(source); diff --git a/src/protocol/dreamforge.c b/src/protocol/dreamforge.c index 78718000f..926c73655 100644 --- a/src/protocol/dreamforge.c +++ b/src/protocol/dreamforge.c @@ -762,7 +762,7 @@ void dreamforge_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { dreamforge_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/hybrid.c b/src/protocol/hybrid.c index 7f2230b6d..4211925e5 100644 --- a/src/protocol/hybrid.c +++ b/src/protocol/hybrid.c @@ -466,7 +466,7 @@ void hybrid_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { hybrid_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/inspircd10.c b/src/protocol/inspircd10.c index e51b78786..c0c259169 100644 --- a/src/protocol/inspircd10.c +++ b/src/protocol/inspircd10.c @@ -742,7 +742,7 @@ void inspircd_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { inspircd_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 45de2111b..19c673e46 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -800,7 +800,7 @@ void inspircd_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { inspircd_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/plexus2.c b/src/protocol/plexus2.c index c4ad300af..33437c263 100644 --- a/src/protocol/plexus2.c +++ b/src/protocol/plexus2.c @@ -539,7 +539,7 @@ plexus_cmd_notice (char *source, char *dest, char *buf) return; } - if (UsePrivmsg) + if (NSDefFlags & NI_MSG) { plexus_cmd_privmsg2 (source, dest, buf); } diff --git a/src/protocol/plexus3.c b/src/protocol/plexus3.c index e245414be..d4054d230 100644 --- a/src/protocol/plexus3.c +++ b/src/protocol/plexus3.c @@ -482,7 +482,7 @@ plexus_cmd_notice (char *source, char *dest, char *buf) return; } - if (UsePrivmsg) + if (NSDefFlags & NI_MSG) { plexus_cmd_privmsg2 (source, dest, buf); } diff --git a/src/protocol/ptlink.c b/src/protocol/ptlink.c index beb204975..7711bae55 100644 --- a/src/protocol/ptlink.c +++ b/src/protocol/ptlink.c @@ -957,7 +957,7 @@ void ptlink_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { ptlink_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/rageircd.c b/src/protocol/rageircd.c index 96965a569..c437bd1c4 100644 --- a/src/protocol/rageircd.c +++ b/src/protocol/rageircd.c @@ -876,7 +876,7 @@ void rageircd_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { rageircd_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index e37fd9be7..b81291a16 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -450,7 +450,7 @@ void ratbox_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { ratbox_cmd_privmsg2(source, dest, buf); } else { ud = find_uid(source); diff --git a/src/protocol/shadowircd.c b/src/protocol/shadowircd.c index cc2b3c16d..7a59115e7 100644 --- a/src/protocol/shadowircd.c +++ b/src/protocol/shadowircd.c @@ -468,7 +468,7 @@ void shadowircd_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { shadowircd_cmd_privmsg2(source, dest, buf); } else { ud = find_uid(source); diff --git a/src/protocol/solidircd.c b/src/protocol/solidircd.c index 280c0d283..44621f91a 100644 --- a/src/protocol/solidircd.c +++ b/src/protocol/solidircd.c @@ -1076,7 +1076,7 @@ void solidircd_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { solidircd_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/ultimate2.c b/src/protocol/ultimate2.c index ff3f79d5f..bb0732e3c 100644 --- a/src/protocol/ultimate2.c +++ b/src/protocol/ultimate2.c @@ -1260,7 +1260,7 @@ void ultimate2_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { ultimate2_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/ultimate3.c b/src/protocol/ultimate3.c index cc01c284f..2306a71c0 100644 --- a/src/protocol/ultimate3.c +++ b/src/protocol/ultimate3.c @@ -1111,7 +1111,7 @@ void ultimate3_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { ultimate3_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/unreal31.c b/src/protocol/unreal31.c index fb1585827..7a8c2baf0 100644 --- a/src/protocol/unreal31.c +++ b/src/protocol/unreal31.c @@ -626,7 +626,7 @@ void unreal_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { unreal_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 4a0ddbf0e..4fffbfe98 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -664,7 +664,7 @@ void unreal_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { unreal_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "%s %s :%s", send_token("NOTICE", "B"), dest, diff --git a/src/protocol/viagra.c b/src/protocol/viagra.c index 56ba9b9c8..5cb5b2f40 100644 --- a/src/protocol/viagra.c +++ b/src/protocol/viagra.c @@ -1146,7 +1146,7 @@ void viagra_cmd_notice(char *source, char *dest, char *buf) return; } - if (UsePrivmsg) { + if (NSDefFlags & NI_MSG) { viagra_cmd_privmsg2(source, dest, buf); } else { send_cmd(source, "NOTICE %s :%s", dest, buf); 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); diff --git a/version.log b/version.log index 8b25347d5..eca7b2a84 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="18" VERSION_EXTRA="-svn" -VERSION_BUILD="1244" +VERSION_BUILD="1245" # $Log$ # +# 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 +# # BUILD : 1.7.18 (1244) # BUGS : 713 719 # NOTES : Corrected typo in rdb.c, added code in backup_databases() and remove_backups() to backup the prenick db, and added checks in remove_backups() for s_BotServ and s_HostServ being NULL |