* [PATCH 2/7] view: favor SearchMsg for In-Reply-To over Email::MIME
2016-12-10 3:42 5% [PATCH 0/7] message threading fixes for WWW UI Eric Wong
@ 2016-12-10 3:43 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-12-10 3:43 UTC (permalink / raw)
To: meta
This should avoid warnings during thread skeleton generation if
ever the Xapian database disagrees with View.pm about which is
the proper direct parent of a message. We will treat the data
in Xapian as the truth (if Xapian is available).
---
lib/PublicInbox/View.pm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 2bfbb80..feac601 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -127,13 +127,13 @@ sub index_entry {
my $id_m = 'm'.$id;
my $root_anchor = $ctx->{root_anchor} || '';
- my $irt = in_reply_to($hdr);
+ my $irt;
my $rv = "<a\nhref=#e$id\nid=m$id>*</a> ";
$subj = '<b>'.ascii_html($subj).'</b>';
$subj = "<u\nid=u>$subj</u>" if $root_anchor eq $id_m;
$rv .= $subj . "\n";
- $rv .= _th_index_lite($mid_raw, $irt, $id, $ctx);
+ $rv .= _th_index_lite($mid_raw, \$irt, $id, $ctx);
my @tocc;
foreach my $f (qw(To Cc)) {
my $dst = _hdr_names($hdr, $f);
@@ -147,7 +147,7 @@ sub index_entry {
$rv .= ' '.join('; +', @tocc) . "\n" if @tocc;
my $mapping = $ctx->{mapping};
- if (!$mapping && $irt) {
+ if (!$mapping && (defined($irt) || defined($irt = in_reply_to($hdr)))) {
my $mirt = PublicInbox::Hval->new_msgid($irt);
my $href = $upfx . $mirt->{href}. '/';
my $html = $mirt->as_html;
@@ -206,7 +206,10 @@ sub _th_index_lite {
my $nr_c = scalar @$children;
my $nr_s = 0;
my $siblings;
- my $irt_map = $mapping->{$irt} if defined $irt;
+ if (my $smsg = $node->{smsg}) {
+ ($$irt) = (($smsg->{references} || '') =~ m/<([^>]+)>\z/);
+ }
+ my $irt_map = $mapping->{$$irt} if defined $$irt;
if (defined $irt_map) {
$siblings = $irt_map->[1]->{children};
$nr_s = scalar(@$siblings) - 1;
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/7] message threading fixes for WWW UI
@ 2016-12-10 3:42 5% Eric Wong
2016-12-10 3:43 7% ` [PATCH 2/7] view: favor SearchMsg for In-Reply-To over Email::MIME Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-12-10 3:42 UTC (permalink / raw)
To: meta
This series improves thread handling in several oddball
cases.
In the Xapian search indexing phase, the In-Reply-To header
is always considered the last (direct) parent of a message.
This is necessary in cases where a MUA specifies References
in an invalid order. This is also what our View.pm display
has done for generating "reply" links.
Not many repos are affected by this, but
"public-inbox-index --reindex" will make those consistent
(there is no incompatible Xapian DB version bump).
We will now prune ghosts without children before display, as
they are sometimes the result of buggy (or malicious) MUAs
inserting spaces or otherwise mangling References: headers.
Ghosts with valid children remain shown, as they are likely to
be legitimate (but lost) messages.
Deploying over the next few hours, .onions first!
Currently reindexing git@vger mirror:
http://czquwvybam4bgbro.onion/meta
Up next:
http://hjrcffqmbrq6wope.onion/meta
Last: (also public-inbox.org)
http://ou63pmih66umazou.onion/meta
Eric Wong (7):
search: favor In-Reply-To over last References iff IRT exists
view: favor SearchMsg for In-Reply-To over Email::MIME
thread: fix comment describing its existence
view: reduce indentation for skeleton generation
view: skip ghosts with no direct children
thread: last Reference always wins
search: always sort thread results in ascending time order
lib/PublicInbox/Mbox.pm | 2 +-
lib/PublicInbox/Search.pm | 5 ++++
lib/PublicInbox/SearchIdx.pm | 22 ++++++++++++---
lib/PublicInbox/SearchThread.pm | 30 ++++++++++++++------
lib/PublicInbox/View.pm | 61 +++++++++++++++++++++--------------------
t/thread-cycle.t | 8 ------
6 files changed, 76 insertions(+), 52 deletions(-)
--
EW
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-12-10 3:42 5% [PATCH 0/7] message threading fixes for WWW UI Eric Wong
2016-12-10 3:43 7% ` [PATCH 2/7] view: favor SearchMsg for In-Reply-To over Email::MIME Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).