summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-29 21:01:48 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-29 21:01:48 +0000
commit1e0bfbd15a2c041902023be6a614cd2db4e1534f (patch)
tree07248d9f47bcdf56237e42763f815816160f561a
parentcb73ab9d23633a5812d45658404f17b0992394ea (diff)
Fixed bugs #1146 and #1147 - Fixed check_modes to only apply defcon settings when defcon is actually on
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2841 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--src/chanserv.c13
-rw-r--r--version.log3
3 files changed, 10 insertions, 7 deletions
diff --git a/Changes b/Changes
index 54a30429b..0c07f9061 100644
--- a/Changes
+++ b/Changes
@@ -27,6 +27,7 @@ Provided by Anope Dev. <team@anope.org> - 2009
12/01 F Fixed tracking of users host when they disable their vhost [#1106]
12/20 F Fixed nickcores access list being loaded from SQL with RDB [ #00]
1/15 F Fixed BotServ from kicking and banning ULined clients [#1135]
+3/29 F Fixed defcon to only apply its mode parameters when it's on [#1146]
Provided by Han` <Han@mefalcon.org> - 2009
07/28 F Updated german language file. [ #00]
diff --git a/src/chanserv.c b/src/chanserv.c
index d6c8a6970..046be26b8 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1086,6 +1086,7 @@ void check_modes(Channel * c)
ChannelInfo *ci;
CBModeInfo *cbmi = NULL;
CBMode *cbm = NULL;
+ boolean DefConOn = DefConLevel != 5;
if (!c) {
if (debug) {
@@ -1131,7 +1132,7 @@ void check_modes(Channel * c)
*/
if (ci)
modes = ~c->mode & ci->mlock_on;
- if (DefConModesSet)
+ if (DefConOn && DefConModesSet)
modes |= (~c->mode & DefConModesOn);
/* Initialize the buffers */
@@ -1147,7 +1148,7 @@ void check_modes(Channel * c)
if (cbmi->getvalue && cbmi->csgetvalue) {
char *value;
/* Check if it's a defcon or mlock mode */
- if (DefConModesOn & cbmi->flag)
+ if (DefConOn && DefConModesOn & cbmi->flag)
value = cbmi->csgetvalue(&DefConModesCI);
else if (ci)
value = cbmi->csgetvalue(ci);
@@ -1168,13 +1169,13 @@ void check_modes(Channel * c)
}
} else if (cbmi->getvalue && cbmi->csgetvalue
&& ((ci && (ci->mlock_on & cbmi->flag))
- || (DefConModesOn & cbmi->flag))
+ || (DefConOn && DefConModesOn & cbmi->flag))
&& (c->mode & cbmi->flag)) {
char *value = cbmi->getvalue(c);
char *csvalue;
/* Check if it's a defcon or mlock mode */
- if (DefConModesOn & cbmi->flag)
+ if (DefConOn && DefConModesOn & cbmi->flag)
csvalue = cbmi->csgetvalue(&DefConModesCI);
else if (ci)
csvalue = cbmi->csgetvalue(ci);
@@ -1205,10 +1206,10 @@ void check_modes(Channel * c)
if (ci) {
modes = c->mode & ci->mlock_off;
/* Make sure we don't remove a mode just set by defcon.. ~ Viper */
- if (DefConModesSet)
+ if (DefConOn && DefConModesSet)
modes &= ~(modes & DefConModesOn);
}
- if (DefConModesSet)
+ if (DefConOn && DefConModesSet)
modes |= c->mode & DefConModesOff;
if (modes) {
diff --git a/version.log b/version.log
index b10f57537..b8d028ddf 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,11 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="3"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2840"
+VERSION_BUILD="2841"
# $Log$ # Changes since 1.8.3 Release
+#Revision 2841 - Fixed bugs #1146 and #1147 - Fixed check_modes to only apply defcon settings when defcon is actually on
#Revision 2840 - Fixed bug #1144 - replaced some strcpy calls with strscpy to be safer
#Revision 2837 - Log deleting and clearing XOP access lists
#Revision 2836 - Document usage of the -protocoldebug option in services help