From 7d2c22642310a85bb0ffd8d7c47ac8a62dea860e Mon Sep 17 00:00:00 2001 From: "wicked%sci.fi" <> Date: Sat, 14 Feb 2009 09:45:44 +0000 Subject: Bug 333648: Add flag change to activity log and bugmail when only setter is changed - Patch by Teemu Mannermaa r/a=LpSolit --- Bugzilla/Flag.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Bugzilla/Flag.pm') diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 618cd3ef4..f0286575f 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -515,7 +515,7 @@ sub snapshot { 'attach_id' => $attach_id }); my @summaries; foreach my $flag (@$flags) { - my $summary = $flag->type->name . $flag->status; + my $summary = $flag->setter->nick . ':' . $flag->type->name . $flag->status; $summary .= "(" . $flag->requestee->login . ")" if $flag->requestee; push(@summaries, $summary); } @@ -625,10 +625,13 @@ sub update_activity { my ($bug_id, $attach_id, $timestamp, $old_summaries, $new_summaries) = @_; my $dbh = Bugzilla->dbh; - $old_summaries = join(", ", @$old_summaries); - $new_summaries = join(", ", @$new_summaries); - my ($removed, $added) = diff_strings($old_summaries, $new_summaries); - if ($removed ne $added) { + my ($removed, $added) = diff_arrays($old_summaries, $new_summaries); + if (scalar @$removed || scalar @$added) { + # Remove flag requester/setter information + foreach (@$removed, @$added) { s/^\S+:// } + + $removed = join(", ", @$removed); + $added = join(", ", @$added); my $field_id = get_field_id('flagtypes.name'); $dbh->do('INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added) -- cgit v1.2.3-24-g4f1b