CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2004-01-21 02:57:07 UTC

Modified files:
     ChangeLog include/channel.h ircd/channel.c

Log message:

Author: Gavin Grieve <[EMAIL PROTECTED]> (by way of Kev <[EMAIL PROTECTED]>)
Log message:

This code was originally written by Entrope for u2.10.11.05, a minor change was needed 
for u2.10.12.  Compiles cleanly and initial testing showed a single part message as it 
should be.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.387 ircu2.10/ChangeLog:1.388
--- ircu2.10/ChangeLog:1.387    Wed Aug 13 08:01:44 2003
+++ ircu2.10/ChangeLog  Tue Jan 20 18:56:56 2004
@@ -1,3 +1,8 @@
+2004-01-21 Gavin Grieve <[EMAIL PROTECTED]>
+
+       * ircd/channel.c, include/channel.h: bring forward the IsUserParting()
+         code to resolve the multiple part messages bug written by Entrope.
+
 2003-08-12 Timothy Vogelsang <[EMAIL PROTECTED]>
 
         * ircd/match.c: (match) rewrote function based on existing
Index: ircu2.10/include/channel.h
diff -u ircu2.10/include/channel.h:1.36 ircu2.10/include/channel.h:1.37
--- ircu2.10/include/channel.h:1.36     Tue Aug 12 02:41:16 2003
+++ ircu2.10/include/channel.h  Tue Jan 20 18:56:57 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: channel.h,v 1.36 2003/08/12 09:41:16 denspike Exp $
+ * $Id: channel.h,v 1.37 2004/01/21 02:56:57 klmitch Exp $
  */
 #ifndef INCLUDED_channel_h
 #define INCLUDED_channel_h
@@ -70,6 +70,7 @@
 #define CHFL_BURST_ALREADY_OPPED       0x04000  /* In oob BURST, but was already 
joined and opped */
 #define CHFL_BURST_ALREADY_VOICED      0x08000  /* In oob BURST, but was already 
joined and voiced */
 #define CHFL_CHANNEL_MANAGER   0x10000 /* Set when creating channel or using Apass */
+#define CHFL_USER_PARTING       0x20000  /* User is already parting that channel */
 
 #define CHFL_OVERLAP         (CHFL_CHANOP | CHFL_VOICE)
 #define CHFL_BANVALIDMASK    (CHFL_BANVALID | CHFL_BANNED)
@@ -191,6 +192,7 @@
 #define IsBurstJoined(x)    ((x)->status & CHFL_BURST_JOINED)
 #define IsVoicedOrOpped(x)  ((x)->status & CHFL_VOICED_OR_OPPED)
 #define IsChannelManager(x) ((x)->status & CHFL_CHANNEL_MANAGER)
+#define IsUserParting(x)    ((x)->status & CHFL_USER_PARTING)
 
 #define SetBanned(x)        ((x)->status |= CHFL_BANNED)
 #define SetBanValid(x)      ((x)->status |= CHFL_BANVALID)
@@ -200,6 +202,7 @@
 #define SetZombie(x)        ((x)->status |= CHFL_ZOMBIE)
 #define SetChannelManager(x) ((x)->status |= CHFL_CHANNEL_MANAGER)
 #define SetOpLevel(x, v)    (void)((x)->oplevel = (v))
+#define SetUserParting(x)   ((x)->status |= CHFL_USER_PARTING)
 
 #define ClearBanned(x)      ((x)->status &= ~CHFL_BANNED)
 #define ClearBanValid(x)    ((x)->status &= ~CHFL_BANVALID)
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.85 ircu2.10/ircd/channel.c:1.86
--- ircu2.10/ircd/channel.c:1.85        Tue Aug 12 02:41:16 2003
+++ ircu2.10/ircd/channel.c     Tue Jan 20 18:56:57 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: channel.c,v 1.85 2003/08/12 09:41:16 denspike Exp $
+ * $Id: channel.c,v 1.86 2004/01/21 02:56:57 klmitch Exp $
  */
 #include "config.h"
 
@@ -3139,6 +3139,11 @@
 
   if (jbuf->jb_type == JOINBUF_TYPE_PART ||
       jbuf->jb_type == JOINBUF_TYPE_PARTALL) {
+    struct Membership *member = find_member_link(chan, jbuf->jb_source);
+    if (IsUserParting(member))
+      return;
+    SetUserParting(member);
+
     /* Send notification to channel */
     if (!(flags & CHFL_ZOMBIE))
       sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_PART, chan, NULL,
----------------------- End of diff -----------------------

Reply via email to