summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-06-03 08:21:19 +0200
committerByron Jones <glob@mozilla.com>2015-06-03 08:21:19 +0200
commitdb5bf69868f0c3581f5f016cdcbaf3d6359612b8 (patch)
tree477bfc449769e619b6528e32d2137c81e65f4dfc /extensions
parent311d6a011de32aaab723d8c72f95b1a26bc8ae7b (diff)
downloadbugzilla-db5bf69868f0c3581f5f016cdcbaf3d6359612b8.tar.gz
bugzilla-db5bf69868f0c3581f5f016cdcbaf3d6359612b8.tar.xz
Bug 1146772: alternative comment ordering isn't supported (newest first, etc)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/lib/ActivityStream.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/extensions/BugModal/lib/ActivityStream.pm b/extensions/BugModal/lib/ActivityStream.pm
index 97edf2ee6..4d399854f 100644
--- a/extensions/BugModal/lib/ActivityStream.pm
+++ b/extensions/BugModal/lib/ActivityStream.pm
@@ -61,7 +61,17 @@ sub activity_stream {
@{ $change_set->{activity} }
];
}
- $self->{activity_stream} = [ sort { $a->{time} <=> $b->{time} } @$stream ];
+ my $order = Bugzilla->user->setting('comment_sort_order');
+ if ($order eq 'oldest_to_newest') {
+ $self->{activity_stream} = [ sort { $a->{time} <=> $b->{time} } @$stream ];
+ }
+ elsif ($order eq 'newest_to_oldest') {
+ $self->{activity_stream} = [ sort { $b->{time} <=> $a->{time} } @$stream ];
+ }
+ elsif ($order eq 'newest_to_oldest_desc_first') {
+ my $desc = shift @$stream;
+ $self->{activity_stream} = [ $desc, sort { $b->{time} <=> $a->{time} } @$stream ];
+ }
}
return $self->{activity_stream};
}