From f74595a9f08d0b5e1b0f7d04bc6478252eeced65 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Tue, 27 Mar 2007 02:54:44 +0000 Subject: [PATCH] Do not try twice to process silences that were both added and deleted. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1790 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 +++++ ircd/m_silence.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42aae94..e653729 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-26 Michael Poole + + * ircd/m_silence.c (forward_silences): Do not try twice to process + silences that were both added and deleted. + 2007-03-26 Michael Poole * ircd/ircd_parser.y (portblock): Restore old behavior for Port diff --git a/ircd/m_silence.c b/ircd/m_silence.c index 4530d6b..818c6ff 100644 --- a/ircd/m_silence.c +++ b/ircd/m_silence.c @@ -64,6 +64,7 @@ apply_silence(struct Client *sptr, char *mask) { struct Ban *sile; int flags; + int res; char orig_mask[NICKLEN+USERLEN+HOSTLEN+3]; assert(mask && mask[0]); @@ -100,7 +101,8 @@ apply_silence(struct Client *sptr, char *mask) } /* Apply it to the silence list. */ - return apply_ban(&cli_user(sptr)->silence, sile, 1) ? NULL : sile; + res = apply_ban(&cli_user(sptr)->silence, sile, 1); + return res ? NULL : sile; } /** Apply and send silence updates for a user. @@ -123,7 +125,6 @@ forward_silences(struct Client *sptr, char *silences, struct Client *dest) accepted[ac_count++] = sile; } - if (MyUser(sptr)) { size_t siles, maxsiles, totlength, maxlength, jj; @@ -258,8 +259,9 @@ forward_silences(struct Client *sptr, char *silences, struct Client *dest) /* Free any silence-deleting updates. */ for (ii = 0; ii < ac_count; ++ii) { - if (accepted[ii]->flags & BAN_DEL) + if ((accepted[ii]->flags & (BAN_ADD | BAN_DEL)) == BAN_DEL) { free_ban(accepted[ii]); + } } } -- 2.20.1