From 0bd92669e6bd6cde59e85cbf9e827feb94d2536c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 25 Feb 2006 06:53:30 +0000 Subject: Bug 328449: Remove BugMail::MessageToMTA() from Bug::RemoveVotes() - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editproducts.cgi | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'editproducts.cgi') diff --git a/editproducts.cgi b/editproducts.cgi index d9ebcedd9..dc288a54b 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -23,7 +23,7 @@ # Dawn Endico # Joe Robins # Gavin Shelley -# Fr��ic Buclin +# Frédéric Buclin # Greg Hendricks # Lance Larsh # @@ -39,6 +39,7 @@ require "globals.pl"; use Bugzilla::Bug; use Bugzilla::Series; use Bugzilla::Config qw(:DEFAULT $datadir); +use Bugzilla::BugMail; use Bugzilla::Product; use Bugzilla::Classification; use Bugzilla::Milestone; @@ -899,9 +900,15 @@ if ($action eq 'update') { foreach my $vote (@$votes) { my ($who, $id) = (@$vote); - RemoveVotes($id, $who, "The rules for voting on this product " . - "has changed;\nyou had too many votes " . - "for a single bug."); + # If some votes are removed, RemoveVotes() returns a list + # of messages to send to voters. + my $msgs = + RemoveVotes($id, $who, "The rules for voting on this product " . + "has changed;\nyou had too many votes " . + "for a single bug."); + foreach my $msg (@$msgs) { + Bugzilla::BugMail::MessageToMTA($msg); + } my $name = DBID_to_name($who); push(@toomanyvotes_list, @@ -945,10 +952,16 @@ if ($action eq 'update') { undef, ($product->id, $who)); foreach my $bug_id (@$bug_ids) { - RemoveVotes($bug_id, $who, "The rules for voting on this " . - "product has changed; you had " . - "too many\ntotal votes, so all " . - "votes have been removed."); + # RemoveVotes() returns a list of messages to send + # in case some voters had too many votes. + my $msgs = + RemoveVotes($bug_id, $who, "The rules for voting on this " . + "product has changed; you had " . + "too many\ntotal votes, so all " . + "votes have been removed."); + foreach my $msg (@$msgs) { + Bugzilla::BugMail::MessageToMTA($msg); + } my $name = DBID_to_name($who); push(@toomanytotalvotes_list, -- cgit v1.2.3-24-g4f1b