about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-06 07:21:12 +0000
committerEric Wong <e@80x24.org>2016-04-06 07:21:12 +0000
commitaf4959d5148b60b2549712b5955fd66d71e9a63a (patch)
treebf3cc2083e594a0a8999152fcf9782fa9bbd2ab5 /lib
parent7905c86d857a69d821a9d1cdad0344fe4e4a70e9 (diff)
downloadpublic-inbox-af4959d5148b60b2549712b5955fd66d71e9a63a.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/View.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 2cf7e4f0..5f9ecd10 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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