]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: do not prune ghosts from threads
authorEric Wong <e@80x24.org>
Wed, 6 Apr 2016 07:21:12 +0000 (07:21 +0000)
committerEric Wong <e@80x24.org>
Wed, 6 Apr 2016 07:21:12 +0000 (07:21 +0000)
Keeping readers informed of ghost messages is important,
so do not ever prune them.  Previously, ghosts could get
pruned and sole children would get promoted as the new
root.

lib/PublicInbox/View.pm

index 2cf7e4f01ff120c8c6b4ef3634b944c7f0332043..5f9ecd108aacf444b1ad07a46bfd2b356865ecf8 100644 (file)
@@ -729,8 +729,16 @@ sub thread_results {
        my ($msgs, $nosubject) = @_;
        require PublicInbox::Thread;
        my $th = PublicInbox::Thread->new(@$msgs);
+
+       # 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';
        $Mail::Thread::nosubject = $nosubject;
+       # Keep ghosts with only a single direct child:
+       $Mail::Thread::noprune = 1;
        $th->thread;
        $th->order(*sort_ts);
        $th