summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-01-25 20:47:08 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-01-25 20:47:08 +0100
commit2fdfa60f167cbbee507351fba19c8e01880d9ae6 (patch)
tree216a80642b669c42393fcbdb0bb9575c5cfbbdd9 /extensions
parentca52dda997705bc31f077a250e49d5761f381898 (diff)
downloadbugzilla-2fdfa60f167cbbee507351fba19c8e01880d9ae6.tar.gz
bugzilla-2fdfa60f167cbbee507351fba19c8e01880d9ae6.tar.xz
Bug 719526 - Add an extra mail header to messages containing a link to a first patch
r=glob
Diffstat (limited to 'extensions')
-rw-r--r--extensions/TagNewUsers/Extension.pm22
1 files changed, 22 insertions, 0 deletions
diff --git a/extensions/TagNewUsers/Extension.pm b/extensions/TagNewUsers/Extension.pm
index d71c4ea20..4b78c7bc0 100644
--- a/extensions/TagNewUsers/Extension.pm
+++ b/extensions/TagNewUsers/Extension.pm
@@ -224,6 +224,28 @@ sub _user_is_new {
|| ($user->{creation_age} <= PROFILE_AGE);
}
+sub mailer_before_send {
+ my ($self, $args) = @_;
+ my $email = $args->{email};
+
+ my ($bug_id) = ($email->header('Subject') =~ /^[^\d]+(\d+)/);
+ my $changer_login = $email->header('X-Bugzilla-Who');
+ my $changed_fields = $email->header('X-Bugzilla-Changed-Fields');
+
+ if ($bug_id
+ && $changer_login
+ && $changed_fields =~ /Attachment Created/)
+ {
+ my $changer = Bugzilla::User->new({ name => $changer_login });
+ if ($changer
+ && $changer->first_patch_bug_id
+ && $changer->first_patch_bug_id == $bug_id)
+ {
+ $email->header_set('X-Bugzilla-FirstPatch' => $bug_id);
+ }
+ }
+}
+
sub webservice_user_get {
my ($self, $args) = @_;
my ($webservice, $params, $users) = @$args{qw(webservice params users)};