Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-11-17 02:33:22 UTC
Modified files:
ChangeLog include/ircd_features.h ircd/channel.c
ircd/convert-conf.c ircd/ircd_features.c ircd/m_destruct.c
Log message:
Add ZANNELS feature; tweak recreate after bogus DESTRUCT.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.744 ircu2.10/ChangeLog:1.745
--- ircu2.10/ChangeLog:1.744 Wed Nov 16 17:53:27 2005
+++ ircu2.10/ChangeLog Wed Nov 16 18:33:11 2005
@@ -1,3 +1,12 @@
+2005-11-17 Carlo Wood <[EMAIL PROTECTED]>
+
+ * include/ircd_features.h (Feature): Add ZANNELS.
+ * ircd/ircd_features.c (FeatureDesc): idem.
+ * ircd/channel.c (sub1_from_channel): Don't keep zannels
+ around when ZANNELS and OPLEVELS are FALSE.
+ * ircd/m_destruct.c (ms_destruct): Use JOIN instead of
+ CREATE to recreate a non-empty channel after DESTRUCT.
+
2005-11-16 Michael Poole <[EMAIL PROTECTED]>
* tools/convert-conf.py: Delete obsolete code.
Index: ircu2.10/include/ircd_features.h
diff -u ircu2.10/include/ircd_features.h:1.39
ircu2.10/include/ircd_features.h:1.40
--- ircu2.10/include/ircd_features.h:1.39 Tue Oct 4 19:15:20 2005
+++ ircu2.10/include/ircd_features.h Wed Nov 16 18:33:11 2005
@@ -20,7 +20,7 @@
*/
/** @file
* @brief Public interfaces and declarations for dealing with configurable
features.
- * @version $Id: ircd_features.h,v 1.39 2005/10/05 02:15:20 entrope Exp $
+ * @version $Id: ircd_features.h,v 1.40 2005/11/17 02:33:11 entrope Exp $
*/
struct Client;
@@ -56,6 +56,7 @@
FEAT_HIDDEN_IP,
FEAT_CONNEXIT_NOTICES,
FEAT_OPLEVELS,
+ FEAT_ZANNELS,
FEAT_LOCAL_CHANNELS,
FEAT_TOPIC_BURST,
FEAT_USER_GLIST,
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.163 ircu2.10/ircd/channel.c:1.164
--- ircu2.10/ircd/channel.c:1.163 Mon Nov 14 19:36:26 2005
+++ ircu2.10/ircd/channel.c Wed Nov 16 18:33:11 2005
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.163 2005/11/15 03:36:26 entrope Exp $
+ * @version $Id: channel.c,v 1.164 2005/11/17 02:33:11 entrope Exp $
*/
#include "config.h"
@@ -287,6 +287,22 @@
free_ban(link);
}
chptr->banlist = NULL;
+
+#if 1 /* Temporary code */
+ /* Immediately destruct empty -A channels if ZANNELS is FALSE.
+ When OPLEVELS is true, ZANNELS should be TRUE too. Test for
+ that error. This is done to avoid the DESTRUCT message to
+ occur, which is necessary on a network with mixed versions
+ of 2.10.12.x, with x < 04 *and* 2.10.11 servers. Because
+ servers prior to 2.10.12.04 can cause a BURST message outside
+ the normal net.burst as a result of a DESTRUCT message, and
+ 2.10.11 SQUIT servers when they do that. */
+ if (!(feature_bool(FEAT_ZANNELS) || feature_bool(FEAT_OPLEVELS)))
+ {
+ destruct_channel(chptr);
+ return 0;
+ }
+#endif
}
if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48
hours? */
schedule_destruct_event_1m(chptr); /* Get rid of it in
approximately 4-5 minutes */
Index: ircu2.10/ircd/convert-conf.c
diff -u ircu2.10/ircd/convert-conf.c:1.2 ircu2.10/ircd/convert-conf.c:1.3
--- ircu2.10/ircd/convert-conf.c:1.2 Mon Aug 15 16:22:50 2005
+++ ircu2.10/ircd/convert-conf.c Wed Nov 16 18:33:11 2005
@@ -310,6 +310,7 @@
size_t ii;
fputs("Features {\n\t\"OPLEVELS\" = \"FALSE\";\n", stdout);
+ fputs("Features {\n\t\"ZANNELS\" = \"FALSE\";\n", stdout);
for (feat = features; feat; feat = feat->next) {
/* See if the feature was remapped to an oper privilege. */
Index: ircu2.10/ircd/ircd_features.c
diff -u ircu2.10/ircd/ircd_features.c:1.52 ircu2.10/ircd/ircd_features.c:1.53
--- ircu2.10/ircd/ircd_features.c:1.52 Mon Oct 17 20:20:53 2005
+++ ircu2.10/ircd/ircd_features.c Wed Nov 16 18:33:11 2005
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of configurable feature support.
- * @version $Id: ircd_features.c,v 1.52 2005/10/18 03:20:53 entrope Exp $
+ * @version $Id: ircd_features.c,v 1.53 2005/11/17 02:33:11 entrope Exp $
*/
#include "config.h"
@@ -358,6 +358,7 @@
F_S(HIDDEN_IP, 0, "127.0.0.1", 0),
F_B(CONNEXIT_NOTICES, 0, 0, 0),
F_B(OPLEVELS, 0, 1, set_isupport_chanmodes),
+ F_B(ZANNELS, 0, 1, 0),
F_B(LOCAL_CHANNELS, 0, 1, set_isupport_chantypes),
F_B(TOPIC_BURST, 0, 0, 0),
F_B(USER_GLIST, 0, 1, 0),
Index: ircu2.10/ircd/m_destruct.c
diff -u ircu2.10/ircd/m_destruct.c:1.10 ircu2.10/ircd/m_destruct.c:1.11
--- ircu2.10/ircd/m_destruct.c:1.10 Mon Nov 14 19:13:22 2005
+++ ircu2.10/ircd/m_destruct.c Wed Nov 16 18:33:11 2005
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_destruct.c,v 1.10 2005/11/15 03:13:22 entrope Exp $
+ * $Id: m_destruct.c,v 1.11 2005/11/17 02:33:11 entrope Exp $
*/
#include "config.h"
@@ -143,30 +143,17 @@
a bug that causes two JOIN's for the same user to
result in that user being on the channel twice). */
- struct Membership *chanop;
struct Membership *member;
- int is_real_chanop;
struct ModeBuf mbuf;
struct Ban *link;
- /* First find a channel op, if any. */
- for (chanop = chptr->members; chanop && !IsChanOp(chanop); chanop =
chanop->next_member);
- /* Now chanop is either a channel op, or NULL. */
- is_real_chanop = chanop ? 1 : 0;
-
/* Next, send all PARTs upstream. */
for (member = chptr->members; member; member = member->next_member)
sendcmdto_one(member->user, CMD_PART, cptr, "%H", chptr);
- /* Next, send a CREATE. If we don't have a chanop, just use the first
member. */
- if (!chanop)
- chanop = chptr->members;
- sendcmdto_one(chanop->user, CMD_CREATE, cptr, "%H %Tu", chptr, chanTS);
-
- /* Next, send JOINs for possible other members. */
+ /* Next, send JOINs for all members. */
for (member = chptr->members; member; member = member->next_member)
- if (member != chanop)
- sendcmdto_one(member->user, CMD_JOIN, cptr, "%H", chptr);
+ sendcmdto_one(member->user, CMD_JOIN, cptr, "%H", chptr);
/* Build MODE strings. We use MODEBUF_DEST_BOUNCE with MODE_DEL to assure
that the resulting MODEs are only sent upstream. */
@@ -175,8 +162,8 @@
/* Op/voice the users as appropriate. We use MODE_DEL because we fake a
bounce. */
for (member = chptr->members; member; member = member->next_member)
{
- if (IsChanOp(member) && member != chanop)
- modebuf_mode_client(&mbuf, MODE_DEL | MODE_CHANOP, member->user,
OpLevel(member));
+ if (IsChanOp(member))
+ modebuf_mode_client(&mbuf, MODE_DEL | MODE_CHANOP, member->user,
OpLevel(member));
if (HasVoice(member))
modebuf_mode_client(&mbuf, MODE_DEL | MODE_VOICE, member->user,
MAXOPLEVEL + 1);
}
@@ -194,10 +181,6 @@
for (link = chptr->banlist; link; link = link->next)
modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, link->banstr, 0);
modebuf_flush(&mbuf);
-
- /* When chanop wasn't really a chanop, let him deop himself. */
- if (!is_real_chanop)
- sendcmdto_one(chanop->user, CMD_MODE, cptr, "%H -o %C", chptr,
chanop->user);
#endif
return 0;
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches