X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSmsg.pm;h=171e0a00908e4b7bdf51ba05beda6dcc498aa08c;hb=6c853f5256f3a324c018a37a9e8a6b9fc8fdc063;hp=62cb951eb9603e92376e6bd3318a922b9f830d4e;hpb=86c28d2432292c6bee149f59175486e5610e4462;p=public-inbox.git diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index 62cb951e..171e0a00 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -40,6 +40,7 @@ sub to_doc_data { sub load_from_data ($$) { my ($self) = $_[0]; # data = $_[1] + utf8::decode($_[1]); ( $self->{subject}, $self->{from}, @@ -67,7 +68,6 @@ sub load_expand { my $dt = get_val($doc, PublicInbox::Search::DT()); my ($yyyy, $mon, $dd, $hh, $mm, $ss) = unpack('A4A2A2A2A2A2', $dt); $self->{ds} = timegm($ss, $mm, $hh, $dd, $mon - 1, $yyyy); - utf8::decode($data); load_from_data($self, $data); $self; } @@ -82,18 +82,11 @@ sub psgi_cull ($) { # drop NNTP-only fields which aren't relevant to PSGI results: # saves ~80K on a 200 item search result: - delete @$self{qw(ts to cc bytes lines)}; + # TODO: we may need to keep some of these for JMAP... + delete @$self{qw(tid to cc bytes lines)}; $self; } -# Only called by PSGI interface, not NNTP -sub from_mitem { - my ($mitem, $srch) = @_; - return $srch->retry_reopen(\&from_mitem, $mitem) if $srch; - my $self = bless {}, __PACKAGE__; - psgi_cull(load_expand($self, $mitem->get_document)); -} - # for Import and v1 non-SQLite WWW code paths sub populate { my ($self, $hdr, $sync) = @_;