diff options
author | Eric Wong <e@80x24.org> | 2021-05-21 10:28:30 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-23 01:33:05 +0000 |
commit | 4420ed836691b94d14c79127990aba27673759eb (patch) | |
tree | ddd5aaf9f8b22b06e9ff497d6831459df7d99dc9 /lib/PublicInbox/LeiSearch.pm | |
parent | 084dbf65370806af408586603dbc893d3d5cf9bc (diff) | |
download | public-inbox-4420ed836691b94d14c79127990aba27673759eb.tar.gz |
IMAP will eventually be supported.
Diffstat (limited to 'lib/PublicInbox/LeiSearch.pm')
-rw-r--r-- | lib/PublicInbox/LeiSearch.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm index fb19229f..9297d060 100644 --- a/lib/PublicInbox/LeiSearch.pm +++ b/lib/PublicInbox/LeiSearch.pm @@ -27,6 +27,20 @@ sub msg_keywords { wantarray ? sort(keys(%$kw)) : $kw; } +# returns undef if blob is unknown +sub oid_keywords { + my ($self, $oidhex) = @_; + my @num = $self->over->blob_exists($oidhex) or return; + my $xdb = $self->xdb; # set {nshard}; + my %kw; + for my $num (@num) { # there should only be one... + my $doc = $xdb->get_document(num2docid($self, $num)); + my $x = xap_terms('K', $doc); + %kw = (%kw, %$x); + } + \%kw; +} + # lookup keywords+labels for external messages sub xsmsg_vmd { my ($self, $smsg, $want_label) = @_; |