user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/2] nntp: use lookup_mail instead of lookup_message
Date: Mon, 20 Jun 2016 07:22:24 +0000	[thread overview]
Message-ID: <20160620072224.23973-3-e@80x24.org> (raw)
In-Reply-To: <20160620072224.23973-1-e@80x24.org>

lookup_mail is safer since it won't inadvertently load ghosts.
---
 lib/PublicInbox/NNTP.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 93f654f..4b116a7 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -711,8 +711,7 @@ sub hdr_xref ($$$) { # optimize XHDR Xref [range] for rtin
 
 sub search_header_for {
 	my ($srch, $mid, $field) = @_;
-	my $smsg = $srch->lookup_message($mid) or return;
-	$smsg = PublicInbox::SearchMsg->load_doc($smsg->{doc});
+	my $smsg = $srch->lookup_mail($mid) or return;
 	$smsg->$field;
 }
 
@@ -847,10 +846,9 @@ sub cmd_over ($;$) {
 	my ($self, $range) = @_;
 	if ($range && $range =~ /\A<(.+)>\z/) {
 		my ($ng, $n) = mid_lookup($self, $1);
-		my $smsg = $ng->search->lookup_message($range) or
+		my $smsg = $ng->search->lookup_mail($range) or
 			return '430 No article with that message-id';
 		more($self, '224 Overview information follows (multi-line)');
-		$smsg = PublicInbox::SearchMsg->load_doc($smsg->{doc});
 
 		# Only set article number column if it's the current group
 		my $self_ng = $self->{ng};

      parent reply	other threads:[~2016-06-20  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  7:22 [PATCH 0/2] better ghost handling Eric Wong
2016-06-20  7:22 ` [PATCH 1/2] www: improve topic view by scanning for ghosts Eric Wong
2016-06-20  7:22 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160620072224.23973-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).