* [PATCH 0/2] Subject-less message support
@ 2016-06-21 10:35 Eric Wong
2016-06-21 10:35 ` [PATCH 1/2] search: support Subject:-less messages Eric Wong
2016-06-21 10:35 ` [PATCH 2/2] view: support non-existent Subjects for permalink titles Eric Wong
0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2016-06-21 10:35 UTC (permalink / raw)
To: meta
Eric Wong (2):
search: support Subject:-less messages
view: support non-existent Subjects for permalink titles
lib/PublicInbox/Search.pm | 11 +++++++----
lib/PublicInbox/View.pm | 1 +
2 files changed, 8 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] search: support Subject:-less messages
2016-06-21 10:35 [PATCH 0/2] Subject-less message support Eric Wong
@ 2016-06-21 10:35 ` Eric Wong
2016-06-21 10:35 ` [PATCH 2/2] view: support non-existent Subjects for permalink titles Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-06-21 10:35 UTC (permalink / raw)
To: meta
Some mailing lists allow empty Subject headers and we shall support
searching and indexing them.
---
lib/PublicInbox/Search.pm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index bf50365..3a908ac 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -107,12 +107,15 @@ sub get_thread {
return { total => 0, msgs => [] } unless $smsg;
my $qtid = Search::Xapian::Query->new(xpfx('thread').$smsg->thread_id);
- my $path = id_compress($smsg->path);
- my $qsub = Search::Xapian::Query->new(xpfx('path').$path);
- my $query = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
+ my $path = $smsg->path;
+ if (defined $path && $path ne '') {
+ my $path = id_compress($smsg->path);
+ my $qsub = Search::Xapian::Query->new(xpfx('path').$path);
+ $qtid = Search::Xapian::Query->new(OP_OR, $qtid, $qsub);
+ }
$opts ||= {};
$opts->{limit} ||= 1000;
- _do_enquire($self, $query, $opts);
+ _do_enquire($self, $qtid, $opts);
}
sub _do_enquire {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] view: support non-existent Subjects for permalink titles
2016-06-21 10:35 [PATCH 0/2] Subject-less message support Eric Wong
2016-06-21 10:35 ` [PATCH 1/2] search: support Subject:-less messages Eric Wong
@ 2016-06-21 10:35 ` Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-06-21 10:35 UTC (permalink / raw)
To: meta
Showing "(no subject)" seems like a common fallback for
messages without a Subject header.
---
lib/PublicInbox/View.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index b6fa2a3..8e81391 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -353,6 +353,7 @@ sub _msg_html_prepare {
$rv .= "$h: $v\n";
}
+ $title[0] ||= '(no subject)';
$ctx->{-title_html} = join(' - ', @title);
$rv .= 'Message-ID: <' . $mid->as_html . '> ';
$rv .= "(<a\nhref=\"raw\">raw</a>)\n";
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-21 10:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21 10:35 [PATCH 0/2] Subject-less message support Eric Wong
2016-06-21 10:35 ` [PATCH 1/2] search: support Subject:-less messages Eric Wong
2016-06-21 10:35 ` [PATCH 2/2] view: support non-existent Subjects for permalink titles Eric Wong
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).