From f73644bd7c133569fbca159631e0bcc59a78a150 Mon Sep 17 00:00:00 2001 From: "justdave%syndicomm.com" Date: Sat, 7 Apr 2001 16:36:45 +0000 Subject: [PATCH] Fix for bug 71912: changes email pref for "If I'm removed from that capacity" to "If I'm added to or removed from that capacity", so you can still get mail when someone adds you to a CC. Patch by r= justdave git-svn-id: svn://10.0.0.236/trunk@91658 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/processmail | 23 +++++++++++++++++++++-- mozilla/webtools/bugzilla/userprefs.cgi | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/bugzilla/processmail b/mozilla/webtools/bugzilla/processmail index c9e006d4e60..6dc3768790d 100755 --- a/mozilla/webtools/bugzilla/processmail +++ b/mozilla/webtools/bugzilla/processmail @@ -679,6 +679,21 @@ sub getEmailAttributes ($@) { } elsif ( $fieldName eq 'CC') { push (@flags, 'CC'); } + + # These next few lines are for finding out who's been added + # to the Owner, QA, CC, etc. fields. It does not effect + # the @flags array at all, but is run here because it does + # effect filtering later and we're already in the loop. + if ($fieldName eq 'Owner') { + push (@{$force{'Owner'}}, $new); + } elsif ($fieldName eq 'QAContact') { + push (@{$force{'QAContact'}}, $new); + } elsif ($fieldName eq 'CC') { + my @oldVal = split (/,/, $old); + my @newVal = split (/,/, $new); + my @added = filterExcludeList(\@newVal, \@oldVal); + push (@{$force{'CClist'}}, @added); + } } if ( $commentField =~ /Created an attachment \(/ ) { @@ -831,8 +846,12 @@ sub filterEmailGroup ($$$) { pop(@filteredList); } - # check to see if the person was removed from this email - # group. + # check to see if the person was added to or removed from + # this email group. + # Note: This was originally written as only removed from + # and was rewritten to be Added/Removed, but for simplicity + # sake, the name "Removeme" wasn't changed. + # http://bugzilla.mozilla.org/show_bug.cgi?id=71912 if ( grep ($_ eq $person, @{$force{$emailGroup}} ) ) { diff --git a/mozilla/webtools/bugzilla/userprefs.cgi b/mozilla/webtools/bugzilla/userprefs.cgi index a02605aec8a..0d890499dbb 100755 --- a/mozilla/webtools/bugzilla/userprefs.cgi +++ b/mozilla/webtools/bugzilla/userprefs.cgi @@ -49,7 +49,7 @@ my @emailGroups = ( ); my @emailFlags = ( - 'Removeme', 'If I am removed from that capacity', + 'Removeme', 'When I\'m added to or removed from this capacity', 'Comments', 'New Comments', 'Attachments', 'New Attachments', 'Status', 'Priority, status, severity, and milestone changes',