package PublicInbox::WwwListing;
use strict;
use warnings;
-use PublicInbox::Hval qw(ascii_html prurl);
+use PublicInbox::Hval qw(ascii_html prurl fmt_ts);
use PublicInbox::Linkify;
use PublicInbox::View;
use PublicInbox::Inbox;
sub list_match_domain_i {
my ($ibx, $arg) = @_;
my ($list, $hide_key, $re) = @$arg;
- if (!$ibx->{-hide}->{$hide_key} && grep($re, @{$ibx->{url}})) {
+ if (!$ibx->{-hide}->{$hide_key} && grep(/$re/, @{$ibx->{url}})) {
push @$list, $ibx;
}
}
# TODO: +cgit
my %VALID = (
- all => *list_all,
- 'match=domain' => *list_match_domain,
- 404 => *list_404,
+ all => \&list_all,
+ 'match=domain' => \&list_match_domain,
+ 404 => \&list_404,
);
sub set_cb ($$$) {
sub ibx_entry {
my ($mtime, $ibx, $env) = @_;
- my $ts = PublicInbox::View::fmt_ts($mtime);
+ my $ts = fmt_ts($mtime);
my $url = prurl($env, $ibx->{url});
my $tmp = <<"";
* $ts - $url