diff options
author | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
commit | 0bd92669e6bd6cde59e85cbf9e827feb94d2536c (patch) | |
tree | a8fd330947eddfe0b18dbd5e6a1280384821168f /Bugzilla | |
parent | 80db88c9d89fe963ab407304849a3cd452fe1bef (diff) | |
download | bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.gz bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.xz |
Bug 328449: Remove BugMail::MessageToMTA() from Bug::RemoveVotes() - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'Bugzilla')
-rwxr-xr-x | Bugzilla/Bug.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 302ac38b7..71b6bc7f4 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -38,7 +38,6 @@ use vars qw($legal_keywords @legal_platform use CGI::Carp qw(fatalsToBrowser); use Bugzilla::Attachment; -use Bugzilla::BugMail; use Bugzilla::Config; use Bugzilla::Constants; use Bugzilla::Field; @@ -1019,6 +1018,11 @@ sub RemoveVotes { while (my ($name, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = $sth->fetchrow_array()) { push(@list, [$name, $userid, $oldvotes, $votesperuser, $maxvotesperbug]); } + + # @messages stores all emails which have to be sent, if any. + # This array is passed to the caller which will send these emails itself. + my @messages = (); + if (scalar(@list)) { foreach my $ref (@list) { my ($name, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = (@$ref); @@ -1079,7 +1083,7 @@ sub RemoveVotes { $substs{"count"} = $removedvotes . "\n " . $newvotestext; my $msg = perform_substs(Param("voteremovedmail"), \%substs); - Bugzilla::BugMail::MessageToMTA($msg); + push(@messages, $msg); } my $votes = $dbh->selectrow_array("SELECT SUM(vote_count) " . "FROM votes WHERE bug_id = ?", @@ -1087,6 +1091,8 @@ sub RemoveVotes { $dbh->do("UPDATE bugs SET votes = ? WHERE bug_id = ?", undef, ($votes, $id)); } + # Now return the array containing emails to be sent. + return \@messages; } # If a user votes for a bug, or the number of votes required to |