]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 452761: Make the Date header of bugmail and requestmail always be
authorReed Loden <reed@reedloden.com>
Thu, 8 Jul 2010 06:14:56 +0000 (23:14 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 8 Jul 2010 06:14:56 +0000 (23:14 -0700)
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

Bugzilla/Flag.pm
Bugzilla/Mailer.pm
template/en/default/email/newchangedmail.txt.tmpl
template/en/default/request/email.txt.tmpl

index 308eb64d1beb593bdc12033dc47002a85d030604..13dfe6ad9c05250cc796e9ad79c37174fc690e96 100644 (file)
@@ -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) };
index 596e8ab6532bd60df60cd3f21c1f91ca716741e1..c8a99b8730a3a985ed7758d705c3fcf591421e41 100644 (file)
@@ -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()));
         }
     }
 
index 4163306f47c8e9729c2b0b44e846639a91db2912..e138eff23bc958e965f27bf8918d634fdb48ffec 100644 (file)
@@ -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 %]
index e48b2fc1335178269977958205a3b6134c3bfeab..bfb88f287fa2078308dedf747f8776cfbae13986 100644 (file)
@@ -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