about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchMsg.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-08 04:25:51 +0000
committerEric Wong <e@80x24.org>2017-01-08 04:25:51 +0000
commit98a24a7404181006b2a102e9ae5e3a8938fdc172 (patch)
tree287458df7979453cef60dfbdfbc094794300c09a /lib/PublicInbox/SearchMsg.pm
parent68f83ca5236078128a0ccf47a1e54bd955777120 (diff)
parentf1a38b18d9a46531e18143a7cd4c7a66fc89adbc (diff)
downloadpublic-inbox-98a24a7404181006b2a102e9ae5e3a8938fdc172.tar.gz
* origin/master:
  inbox: properly register cleanup timer for git processes
  search: remove subject_summary
  searchmsg: favor direct hash access over accessor methods
  remove incorrect comment about strftime + locales
  config: allow per-inbox nntpserver
  inbox: eliminate weaken usage entirely
  inbox: describe the full key name
  config: remove unused get() method
  config: always use namespaced "publicinboxlimiter"
  qspawn: prepare to support runtime reloading of Limiter
  http: remove weaken usage, reduce anonsub capture scope
  httpd/async: remove weaken usage
  http: fix spelling error
  watch: watchspam affects all configured inboxes
  doc: minor updates to design notes
Diffstat (limited to 'lib/PublicInbox/SearchMsg.pm')
-rw-r--r--lib/PublicInbox/SearchMsg.pm36
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm
index 96406c6f..b8eee665 100644
--- a/lib/PublicInbox/SearchMsg.pm
+++ b/lib/PublicInbox/SearchMsg.pm
@@ -69,7 +69,7 @@ sub subject ($) { __hdr($_[0], 'subject') }
 sub to ($) { __hdr($_[0], 'to') }
 sub cc ($) { __hdr($_[0], 'cc') }
 
-# no strftime, that is locale-dependent
+# no strftime, that is locale-dependent and not for RFC822
 my @DoW = qw(Sun Mon Tue Wed Thu Fri Sat);
 my @MoY = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 
@@ -103,7 +103,7 @@ sub from_name {
 
 sub ts {
         my ($self) = @_;
-        $self->{ts} ||= eval { str2time($self->mime->header('Date')) } || 0;
+        $self->{ts} ||= eval { str2time($self->{mime}->header('Date')) } || 0;
 }
 
 sub to_doc_data {
@@ -146,36 +146,7 @@ sub mid ($;$) {
         }
 }
 
-sub _extract_mid { mid_clean(mid_mime($_[0]->mime)) }
-
-sub blob {
-        my ($self, $x40) = @_;
-        if (defined $x40) {
-                $self->{blob} = $x40;
-        } else {
-                $self->{blob};
-        }
-}
-
-sub mime {
-        my ($self, $mime) = @_;
-        if (defined $mime) {
-                $self->{mime} = $mime;
-        } else {
-                # TODO load from git
-                $self->{mime};
-        }
-}
-
-sub doc_id {
-        my ($self, $doc_id) = @_;
-        if (defined $doc_id) {
-                $self->{doc_id} = $doc_id;
-        } else {
-                # TODO load from xapian
-                $self->{doc_id};
-        }
-}
+sub _extract_mid { mid_clean(mid_mime($_[0]->{mime})) }
 
 sub thread_id {
         my ($self) = @_;
@@ -184,6 +155,7 @@ sub thread_id {
         $self->{thread} = _get_term_val($self, 'G', qr/\AG/); # *G*roup
 }
 
+# XXX: consider removing this, we can phrase match subject
 sub path {
         my ($self) = @_;
         my $path = $self->{path};