summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgeniusdex 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
committergeniusdex 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
commit461af46f0e3ff11615813a36d696829b0a2a12f0 (patch)
tree6cadb39b422a30fda5a6b2e253510ee7a29d2bc1 /src
parent0bdd730f3cfb306f8d1b05bb215693677ecf04ba (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')
-rw-r--r--src/config.c8
-rw-r--r--src/protocol/bahamut.c2
-rw-r--r--src/protocol/charybdis.c2
-rw-r--r--src/protocol/dreamforge.c2
-rw-r--r--src/protocol/hybrid.c2
-rw-r--r--src/protocol/inspircd10.c2
-rw-r--r--src/protocol/inspircd11.c2
-rw-r--r--src/protocol/plexus2.c2
-rw-r--r--src/protocol/plexus3.c2
-rw-r--r--src/protocol/ptlink.c2
-rw-r--r--src/protocol/rageircd.c2
-rw-r--r--src/protocol/ratbox.c2
-rw-r--r--src/protocol/shadowircd.c2
-rw-r--r--src/protocol/solidircd.c2
-rw-r--r--src/protocol/ultimate2.c2
-rw-r--r--src/protocol/ultimate3.c2
-rw-r--r--src/protocol/unreal31.c2
-rw-r--r--src/protocol/unreal32.c2
-rw-r--r--src/protocol/viagra.c2
-rw-r--r--src/send.c31
20 files changed, 50 insertions, 25 deletions
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);