1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 14:36:38 +02:00

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
This commit is contained in:
jantje_85
2009-08-28 23:54:25 +00:00
parent 2874513e0a
commit efa7c81ca8
3 changed files with 38 additions and 15 deletions
+8
View File
@@ -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]
+26 -12
View File
@@ -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));
}
+4 -3
View File
@@ -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