summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-28 23:54:25 +0000
committerjantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-28 23:54:25 +0000
commitefa7c81ca8494e310e35d77bfb9b2aaff9eba484 (patch)
treef3cc65ffe39b63855810881e55493ff9541a81ff
parent2874513e0aa505dcf1307fce064fa9d979222c53 (diff)
Fixed defcon not setting modes on newly created unregged channels and
failing to force remove defcon-locked modes. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2480 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes8
-rw-r--r--src/chanserv.c38
-rw-r--r--version.log7
3 files changed, 38 insertions, 15 deletions
diff --git a/Changes b/Changes
index 6c12f43ac..4da0957ad 100644
--- a/Changes
+++ b/Changes
@@ -6,6 +6,14 @@ Provided by Anope Dev. <team@anope.org> - 2009
08/01 F Fixed several memory leaks in HostServ. [ #00]
08/01 F Fixed several memory leaks in HostServ. [ #00]
08/03 F Fixed TS6 SID issue when introducing new servers. [ #00]
+08/19 F Fixed NS SASET displaying wrong language. [#1094]
+08/24 F Fixed entry_match() failing when given no username. [ #00]
+08/27 F Fixed NS SUSPEND not being shown to services opers. [#1099]
+08/27 F Fixed NS UNSUSPEND not being shown to services opers. [#1100]
+08/27 F Fixed services sending no or wrong help to opers. [#1102]
+08/27 F Fixed services sending no or wrong help to opers. [#1103]
+08/27 F Fixed services sending no or wrong help to opers. [#1104]
+08/29 F Fixed defcon failing to set and remove modes. [#1101]
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 b9784522f..5c70edfb9 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1082,10 +1082,10 @@ void save_cs_rdb_dbase(void)
void check_modes(Channel * c)
{
char modebuf[64], argbuf[BUFSIZE], *end = modebuf, *end2 = argbuf;
- uint32 modes;
+ uint32 modes = 0;
ChannelInfo *ci;
- CBModeInfo *cbmi;
- CBMode *cbm;
+ CBModeInfo *cbmi = NULL;
+ CBMode *cbm = NULL;
if (!c) {
if (debug) {
@@ -1122,13 +1122,15 @@ void check_modes(Channel * c)
anope_cmd_mode(whosends(ci), c->name, "-r");
}
}
- return;
+ /* Channels that are not regged also need the defcon modes.. ~ Viper */
+ /* return; */
}
- /* Initialize te modes-var to set all modes not set yet but which should
+ /* Initialize the modes-var to set all modes not set yet but which should
* be set as by mlock and defcon.
*/
- modes = ~c->mode & ci->mlock_on;
+ if (ci)
+ modes = ~c->mode & ci->mlock_on;
if (DefConModesSet)
modes |= (~c->mode & DefConModesOn);
@@ -1147,8 +1149,13 @@ void check_modes(Channel * c)
/* Check if it's a defcon or mlock mode */
if (DefConModesOn & cbmi->flag)
value = cbmi->csgetvalue(&DefConModesCI);
- else
+ else if (ci)
value = cbmi->csgetvalue(ci);
+ else {
+ value = NULL;
+ if (debug)
+ alog ("Warning: setting modes with unknown origin.");
+ }
cbm = &cbmodes[(int) cbmi->mode];
cbm->setvalue(c, value);
@@ -1160,7 +1167,7 @@ void check_modes(Channel * c)
}
}
} else if (cbmi->getvalue && cbmi->csgetvalue
- && ((ci->mlock_on & cbmi->flag)
+ && ((ci && (ci->mlock_on & cbmi->flag))
|| (DefConModesOn & cbmi->flag))
&& (c->mode & cbmi->flag)) {
char *value = cbmi->getvalue(c);
@@ -1169,8 +1176,13 @@ void check_modes(Channel * c)
/* Check if it's a defcon or mlock mode */
if (DefConModesOn & cbmi->flag)
csvalue = cbmi->csgetvalue(&DefConModesCI);
- else
+ else if (ci)
csvalue = cbmi->csgetvalue(ci);
+ else {
+ csvalue = NULL;
+ if (debug)
+ alog ("Warning: setting modes with unknown origin.");
+ }
/* Lock and actual values don't match, so fix the mode */
if (value && csvalue && strcmp(value, csvalue)) {
@@ -1189,9 +1201,11 @@ void check_modes(Channel * c)
if (*(end - 1) == '+')
end--;
- modes = c->mode & ci->mlock_off;
+ modes = 0;
+ if (ci)
+ modes = c->mode & ci->mlock_off;
if (DefConModesSet)
- modes |= (~c->mode & DefConModesOff);
+ modes |= c->mode & DefConModesOff;
if (modes) {
*end++ = '-';
@@ -1228,7 +1242,7 @@ void check_modes(Channel * c)
*end = 0;
*end2 = 0;
- anope_cmd_mode(whosends(ci), c->name, "%s%s", modebuf,
+ anope_cmd_mode((ci ? whosends(ci) : s_OperServ), c->name, "%s%s", modebuf,
(end2 == argbuf ? "" : argbuf));
}
diff --git a/version.log b/version.log
index e2024c2c5..f550b983e 100644
--- a/version.log
+++ b/version.log
@@ -3,16 +3,17 @@
#
# Please read COPYING and README for further details.
#
-# $Id$
+# $Id: version.log 2479 2009-08-28 23:42:16Z adam- $
VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="2"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2478"
+VERSION_BUILD="2480"
# $Log$ # Changes since 1.8.2 Release
-#Revision 2478 - Updated German language file
+#Revision 2480 - Fixed defcon not setting modes on newly created unregged channels and failing to force remove defcon-locked modes.
+#Revision 2479 - Updated German language file
#Revision 2477 - Corrected help replies for /operserv HELP *NEWS to say services admin is always required
#Revision 2475 - Clarified installing of PSDK for windows installation requirements in Win32.txt
#Revision 2474 - Updated docs/README to include real help for incorporating new languages into builds