X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FThread.pm;h=44a565ad3c7e267196e086ceeb3e00be174a3197;hb=2c69f7bc34a2b12dc7f55e2bb24fa28565f24f03;hp=92404faa258c593d82720f0904db8d32e1a047cb;hpb=64ed451c683eba28e5b9ab4b750e9bcec2f33c97;p=public-inbox.git diff --git a/lib/PublicInbox/Thread.pm b/lib/PublicInbox/Thread.pm index 92404faa..44a565ad 100644 --- a/lib/PublicInbox/Thread.pm +++ b/lib/PublicInbox/Thread.pm @@ -12,25 +12,25 @@ package PublicInbox::Thread; use strict; use warnings; use base qw(Mail::Thread); +# WARNING! both these Mail::Thread knobs were found by inspecting +# the Mail::Thread 2.55 source code, and we have some monkey patches +# in PublicInbox::Thread to fix memory leaks. Since Mail::Thread +# appears unmaintained, I suppose it's safe to depend on these +# variables for now: +{ + no warnings 'once'; + # we want strict threads to expose (and hopefully discourage) + # use of broken email clients + $Mail::Thread::nosubject = 1; + # Keep ghosts with only a single direct child, + # don't hide that there may be missing messages. + $Mail::Thread::noprune = 1; +} 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) - } @_; -} - -sub rsort_ts { - sort { - (eval { $b->topmost->message->header('X-PI-TS') } || 0) <=> - (eval { $a->topmost->message->header('X-PI-TS') } || 0) - } @_; -} - package PublicInbox::Thread::Container; use strict; use warnings;