Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2005-11-17 02:23:37 UTC

Modified files:
  Tag: u2_10_12_branch
     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.710.2.35 ircu2.10/ChangeLog:1.710.2.36
--- ircu2.10/ChangeLog:1.710.2.35       Wed Nov 16 17:36:48 2005
+++ ircu2.10/ChangeLog  Wed Nov 16 18:23:26 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.38 
ircu2.10/include/ircd_features.h:1.38.2.1
--- ircu2.10/include/ircd_features.h:1.38       Thu Jul 14 20:02:32 2005
+++ ircu2.10/include/ircd_features.h    Wed Nov 16 18:23:27 2005
@@ -20,7 +20,7 @@
  */
 /** @file
  * @brief Public interfaces and declarations for dealing with configurable 
features.
- * @version $Id: ircd_features.h,v 1.38 2005/07/15 03:02:32 entrope Exp $
+ * @version $Id: ircd_features.h,v 1.38.2.1 2005/11/17 02:23:27 entrope Exp $
  */
 
 struct Client;
@@ -56,6 +56,7 @@
   FEAT_HIDDEN_IP,
   FEAT_CONNEXIT_NOTICES,
   FEAT_OPLEVELS,
+  FEAT_ZANNELS,
   FEAT_LOCAL_CHANNELS,
   FEAT_TOPIC_BURST,
 
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.155.2.7 ircu2.10/ircd/channel.c:1.155.2.8
--- ircu2.10/ircd/channel.c:1.155.2.7   Mon Nov 14 19:34:30 2005
+++ ircu2.10/ircd/channel.c     Wed Nov 16 18:23:27 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.155.2.7 2005/11/15 03:34:30 entrope Exp $
+ * @version $Id: channel.c,v 1.155.2.8 2005/11/17 02:23:27 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.2.2.1
--- 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:23:27 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.50 
ircu2.10/ircd/ircd_features.c:1.50.2.1
--- ircu2.10/ircd/ircd_features.c:1.50  Fri Jul 15 14:28:34 2005
+++ ircu2.10/ircd/ircd_features.c       Wed Nov 16 18:23:27 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Implementation of configurable feature support.
- * @version $Id: ircd_features.c,v 1.50 2005/07/15 21:28:34 entrope Exp $
+ * @version $Id: ircd_features.c,v 1.50.2.1 2005/11/17 02:23:27 entrope Exp $
  */
 #include "config.h"
 
@@ -309,6 +309,7 @@
   F_S(HIDDEN_IP, 0, "127.0.0.1", 0),
   F_B(CONNEXIT_NOTICES, 0, 0, 0),
   F_B(OPLEVELS, 0, 1, 0),
+  F_B(ZANNELS, 0, 1, 0),
   F_B(LOCAL_CHANNELS, 0, 1, 0),
   F_B(TOPIC_BURST, 0, 0, 0),
 
Index: ircu2.10/ircd/m_destruct.c
diff -u ircu2.10/ircd/m_destruct.c:1.9.2.1 ircu2.10/ircd/m_destruct.c:1.9.2.2
--- ircu2.10/ircd/m_destruct.c:1.9.2.1  Mon Nov 14 19:11:09 2005
+++ ircu2.10/ircd/m_destruct.c  Wed Nov 16 18:23:27 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.9.2.1 2005/11/15 03:11:09 entrope Exp $
+ * $Id: m_destruct.c,v 1.9.2.2 2005/11/17 02:23:27 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

Reply via email to