about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-07 01:44:52 +0000
committerEric Wong <e@80x24.org>2017-01-07 01:45:46 +0000
commitf74b64dbe75226b996367a6049ebd00a3e39ba49 (patch)
tree9d9ddd0d477579e81eef6ffb17a24978d83876df /lib
parent492910d43c179a7e1919b2d0f417aea9473f9730 (diff)
downloadpublic-inbox-f74b64dbe75226b996367a6049ebd00a3e39ba49.tar.gz
Apparently it never actually got used, and the world seems
fine without it, so we can drop it.

While we're at it, consider removing our subject_path
usage from existence, too.  We are not using fancy subject-line
based URLs, here.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Search.pm27
-rw-r--r--lib/PublicInbox/SearchMsg.pm1
2 files changed, 2 insertions, 26 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 86354b57..a1bae419 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -326,6 +326,7 @@ sub find_doc_ids_for_term {
 }
 
 # normalize subjects so they are suitable as pathnames for URLs
+# XXX: consider for removal
 sub subject_path {
         my $subj = pop;
         $subj = subject_normalized($subj);
@@ -343,32 +344,6 @@ sub subject_normalized {
         $subj;
 }
 
-# for doc data
-sub subject_summary {
-        my $subj = pop;
-        my $max = 68;
-        if (length($subj) > $max) {
-                my @subj = split(/\s+/, $subj);
-                $subj = '';
-                my $l;
-
-                while ($l = shift @subj) {
-                        my $new = $subj . $l . ' ';
-                        last if length($new) >= $max;
-                        $subj = $new;
-                }
-                if ($subj ne '') {
-                        my $r = scalar @subj ? ' ...' : '';
-                        $subj =~ s/ \z/$r/s;
-                } else {
-                        # subject has one REALLY long word, and NOT spam? wtf
-                        @subj = ($l =~ /\A(.{1,72})/);
-                        $subj = $subj[0] . ' ...';
-                }
-        }
-        $subj;
-}
-
 sub enquire {
         my ($self) = @_;
         $self->{enquire} ||= Search::Xapian::Enquire->new($self->{xdb});
diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm
index 5bb00778..b8eee665 100644
--- a/lib/PublicInbox/SearchMsg.pm
+++ b/lib/PublicInbox/SearchMsg.pm
@@ -155,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};