Only root messages should be sorted in reverse chronological order,
child messages should be chronological. This gives precedence to
_topics_, but also for initial replies.
This improves readability when several messages appear at the same
nesting level, and helps git patch series' appear correctly as:
[PATCH 0/3] ...
[PATCH 1/3] ...
[PATCH 2/3] ...
[PATCH 3/3] ...
Instead of (what it was previously):
[PATCH 0/3] ...
[PATCH 3/3] ...
[PATCH 2/3] ...
[PATCH 1/3] ...
$feed_opts->{atomurl} . '" type="application/atom+xml"/>' .
'</head><body>' . PRE_WRAP;
$feed_opts->{atomurl} . '" type="application/atom+xml"/>' .
'</head><body>' . PRE_WRAP;
- # sort by date, most recent at top
+ # sort child messages in chronological order
- $b->topmost->message->header('X-PI-Date') <=>
- $a->topmost->message->header('X-PI-Date')
+ $a->topmost->message->header('X-PI-Date') <=>
+ $b->topmost->message->header('X-PI-Date')
- dump_msg($_, 0, \$html, time, \%seen) for $th->rootset;
+ # except we sort top-level messages reverse chronologically
+ for (sort { (eval { $b->message->header('X-PI-Date') } || 0) <=>
+ (eval { $a->message->header('X-PI-Date') } || 0)
+ } $th->rootset) {
+ dump_msg($_, 0, \$html, time, \%seen);
+ }
Email::Address->purge_cache;
Email::Address->purge_cache;