user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 6/9] search: use raw headers without MIME decoding
  2015-08-17  3:38  5% [PATCH 0/9] search pushed and deployed to master Eric Wong
@ 2015-08-17  3:38  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-08-17  3:38 UTC (permalink / raw)
  To: meta

This should be less error-prone in case somebody tries to screw with
us and our thread_id mechanism or somehow waste our resources.
Unfortunately Mail::Thread isn't smart enough for this, yet, so we
may need to downgrade to Email::Simple objects as a workaround.

Or simply not worry about the display so much if somebody is
intentionally trying to make it thread badly/incorrectly.
---
 lib/PublicInbox/Search.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 6fd46f4..051f7a5 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -74,7 +74,7 @@ sub add_message {
 	my $db = $self->{xdb};
 
 	my $doc_id;
-	my $mid = mid_clean($mime->header('Message-ID'));
+	my $mid = mid_clean($mime->header_obj->header_raw('Message-ID'));
 	$mid = mid_compressed($mid);
 	my $was_ghost = 0;
 	my $ct_msg = $mime->header('Content-Type') || 'text/plain';
@@ -341,9 +341,9 @@ sub link_message_to_parents {
 	my $doc = $smsg->{doc};
 	my $mid = mid_compressed($smsg->mid);
 	my $mime = $smsg->mime;
-	my $refs = $mime->header('References');
+	my $refs = $mime->header_obj->header_raw('References');
 	my @refs = $refs ? ($refs =~ /<([^>]+)>/g) : ();
-	my $irt = $mime->header('In-Reply-To');
+	my $irt = $mime->header_obj->header_raw('In-Reply-To');
 	if ($irt) {
 		if ($irt =~ /<([^>]+)>/) {
 			$irt = $1;
@@ -498,7 +498,7 @@ sub index_blob {
 sub unindex_blob {
 	my ($self, $git, $blob) = @_;
 	my $mime = do_cat_mail($git, $blob) or return;
-	my $mid = $mime->header('Message-ID');
+	my $mid = $mime->header_obj->header_raw('Message-ID');
 	eval { $self->remove_message($mid) } if defined $mid;
 	warn "W: unindex_blob $blob: $@\n" if $@;
 }
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] search pushed and deployed to master
@ 2015-08-17  3:38  5% Eric Wong
  2015-08-17  3:38  7% ` [PATCH 6/9] search: use raw headers without MIME decoding Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-08-17  3:38 UTC (permalink / raw)
  To: meta

This should appear shortly in: http://public-inbox.org/meta/

Eric Wong (9):
      feed: remove unnecesary time paramenter in index state
      favor /t/ to /s/, since subjects may change mid-thread
      WWW: eliminate "top" parameter for feeds
      www: simplify parameter passing to feed
      terminology: replies => followups
      search: use raw headers without MIME decoding
      feed: disable the generator statement
      drop bodies and messages ASAP after processing
      search: apply mid_compression to subject paths, too

^ 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 --
2015-08-17  3:38  5% [PATCH 0/9] search pushed and deployed to master Eric Wong
2015-08-17  3:38  7% ` [PATCH 6/9] search: use raw headers without MIME decoding 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).