From 53a141c3d193e74d5921581a2abf7c0535cd2a35 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Wed, 21 Jan 2004 02:56:57 +0000 Subject: [PATCH] Author: Gavin Grieve (by way of Kev ) 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 | 5 +++++ include/channel.h | 3 +++ ircd/channel.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 363eda4..9d3f325 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-21 Gavin Grieve + + * 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 * ircd/match.c: (match) rewrote function based on existing diff --git a/include/channel.h b/include/channel.h index aafcb3c..0fc12e9 100644 --- a/include/channel.h +++ b/include/channel.h @@ -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) diff --git a/ircd/channel.c b/ircd/channel.c index b477c6c..0e8ba01 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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, -- 2.20.1