Author: Gavin Grieve <hektik@dimebox.net> (by way of Kev <klmitch@mit.edu>)
authorKevin L. Mitchell <klmitch@mit.edu>
Wed, 21 Jan 2004 02:56:57 +0000 (02:56 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Wed, 21 Jan 2004 02:56:57 +0000 (02:56 +0000)
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.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1026 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/channel.h
ircd/channel.c

index 363eda4de2220e58a49fbb5b512053129eaacc86..9d3f325887a640fd1188330d32da201d0401f7e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-21 Gavin Grieve <hektik@dimebox.net>
+
+       * 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 <net@astrolink.org>
 
         * ircd/match.c: (match) rewrote function based on existing
index aafcb3c560aac82815cefd2086ba769a8d8d78fb..0fc12e9ccd234ef22e1bdd07b2bcc3c7a9f3d182 100644 (file)
@@ -70,6 +70,7 @@ struct Client;
 #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 @@ struct Membership {
 #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 @@ struct Membership {
 #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 b477c6c08ed6bc4c14a07725453edc2541cd2944..0e8ba0178e2a09c3a6e8237fef2e969e3e3425c1 100644 (file)
@@ -3139,6 +3139,11 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags)
 
   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,