about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-04 02:18:07 +0000
committerEric Wong <e@80x24.org>2015-09-04 02:19:02 +0000
commit559c6c88e81e40d65f68f97044c5a32a114dcbfc (patch)
treeb8f0becda3b5c62ed43b5a361dc3d509d122afd6 /lib
parent8b01b9c9c6cdd42af1e1b968549452b2d727ba52 (diff)
downloadpublic-inbox-559c6c88e81e40d65f68f97044c5a32a114dcbfc.tar.gz
This is a display subroutine so it should not be in our thread
monkey-patching package, but instead in the view package.

Hopefully one day in the future, Mail::Thread will be maintained
again and we'll no longer need PublicInbox::Thread at all.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Thread.pm7
-rw-r--r--lib/PublicInbox/View.pm9
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/PublicInbox/Thread.pm b/lib/PublicInbox/Thread.pm
index a3dedf54..781fffff 100644
--- a/lib/PublicInbox/Thread.pm
+++ b/lib/PublicInbox/Thread.pm
@@ -17,13 +17,6 @@ if ($Mail::Thread::VERSION <= 2.55) {
         eval q(sub _container_class { 'PublicInbox::Thread::Container' });
 }
 
-sub sort_ts {
-        sort {
-                (eval { $a->topmost->message->header('X-PI-TS') } || 0) <=>
-                (eval { $b->topmost->message->header('X-PI-TS') } || 0)
-        } @_;
-}
-
 package PublicInbox::Thread::Container;
 use strict;
 use warnings;
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index ee5ba20e..68adbd72 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -662,7 +662,7 @@ sub thread_results {
         no warnings 'once';
         $Mail::Thread::nosubject = $nosubject;
         $th->thread;
-        $th->order(*PublicInbox::Thread::sort_ts);
+        $th->order(*sort_ts);
         $th
 }
 
@@ -747,6 +747,13 @@ sub inline_dump {
         inline_dump($dst, $state, $upfx, $node->next, $level);
 }
 
+sub sort_ts {
+        sort {
+                (eval { $a->topmost->message->header('X-PI-TS') } || 0) <=>
+                (eval { $b->topmost->message->header('X-PI-TS') } || 0)
+        } @_;
+}
+
 sub rsort_ts {
         sort {
                 (eval { $b->topmost->message->header('X-PI-TS') } || 0) <=>