diff options
author | Reed Loden <reed@reedloden.com> | 2010-07-08 08:14:56 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-08 08:14:56 +0200 |
commit | 0551dc5d31c2472c737a40b3b1c9e87f73732cb3 (patch) | |
tree | 82531d1f1ab75a9d22867be498cd3ca37c3aaf09 | |
parent | 5f7726c010bf79f584d1224e39070ca0f64fe4ff (diff) | |
download | bugzilla-0551dc5d31c2472c737a40b3b1c9e87f73732cb3.tar.gz bugzilla-0551dc5d31c2472c737a40b3b1c9e87f73732cb3.tar.xz |
Bug 452761: Make the Date header of bugmail and requestmail always be
equal to the delta_ts of the bug. This makes emails have the right Date
even when they are sent much later by jobqueue.pl.
r=mkanat, a=mkanat
-rw-r--r-- | Bugzilla/Flag.pm | 8 | ||||
-rw-r--r-- | Bugzilla/Mailer.pm | 2 | ||||
-rw-r--r-- | template/en/default/email/newchangedmail.txt.tmpl | 1 | ||||
-rw-r--r-- | template/en/default/request/email.txt.tmpl | 1 |
4 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 308eb64d1..13dfe6ad9 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -964,18 +964,24 @@ sub notify { # If there are users in the CC list who don't have an account, # use the default language for email notifications. my $default_lang; + my $default_timezone; if (grep { !$_ } values %recipients) { $default_lang = Bugzilla::User->new()->settings->{'lang'}->{'value'}; + $default_timezone = Bugzilla::User->new()->settings->{'timezone'}->{'value'}; } foreach my $to (keys %recipients) { # Add threadingmarker to allow flag notification emails to be the # threaded similar to normal bug change emails. my $thread_user_id = $recipients{$to} ? $recipients{$to}->id : 0; - + + my $timezone = $recipients{$to} ? + $recipients{$to}->settings->{'timezone'}->{'value'} : $default_timezone; + my $vars = { 'flag' => $flag, 'old_flag' => $old_flag, 'to' => $to, + 'timezone' => $timezone, 'bug' => $bug, 'attachment' => $attachment, 'threadingmarker' => build_thread_marker($bug->id, $thread_user_id) }; diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 596e8ab65..c8a99b873 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -157,7 +157,7 @@ sub MessageToMTA { # Sendmail adds a Date: header also, but others may not. if (!defined $email->header('Date')) { - $email->header_set('Date', time2str("%a, %e %b %Y %T %z", time())); + $email->header_set('Date', time2str("%a, %d %b %Y %T %z", time())); } } diff --git a/template/en/default/email/newchangedmail.txt.tmpl b/template/en/default/email/newchangedmail.txt.tmpl index 4163306f4..e138eff23 100644 --- a/template/en/default/email/newchangedmail.txt.tmpl +++ b/template/en/default/email/newchangedmail.txt.tmpl @@ -24,6 +24,7 @@ From: [% Param('mailfrom') %] To: [% to_user.email %] Subject: [[% terms.Bug %] [%+ bug.id %]] [% 'New: ' IF isnew %][%+ bug.short_desc %] +Date: [% bug.delta_ts FILTER time("%a, %d %b %Y %T %z", to_user.timezone) %] X-Bugzilla-Reason: [% reasonsheader %] X-Bugzilla-Type: [% isnew ? 'new' : 'changed' %] X-Bugzilla-Watch-Reason: [% reasonswatchheader %] diff --git a/template/en/default/request/email.txt.tmpl b/template/en/default/request/email.txt.tmpl index e48b2fc13..bfb88f287 100644 --- a/template/en/default/request/email.txt.tmpl +++ b/template/en/default/request/email.txt.tmpl @@ -49,6 +49,7 @@ From: [% Param('mailfrom') %] To: [% to %] Subject: [% flagtype_name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] +Date: [% bug.delta_ts FILTER time("%a, %d %b %Y %T %z", timezone) %] [%- IF attachment %] : [Attachment [% attachment.id %]] [% attachment.description %][% END %] X-Bugzilla-Type: request |