X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwText.pm;h=8b929f7431560979ddb076b321016241e854459a;hb=97510d7a92b4e44318d1917a54c70d536bbf46f2;hp=fabe39f6573077366a9b6d533639f403a7330fba;hpb=625ea784692b43809bb7ed1a45c5855e4f8a046c;p=public-inbox.git diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm index fabe39f6..8b929f74 100644 --- a/lib/PublicInbox/WwwText.pm +++ b/lib/PublicInbox/WwwText.pm @@ -8,6 +8,7 @@ use v5.10.1; use PublicInbox::Linkify; use PublicInbox::WwwStream; use PublicInbox::Hval qw(ascii_html prurl); +use HTTP::Date qw(time2str); use URI::Escape qw(uri_escape_utf8); use PublicInbox::GzipFilter qw(gzf_maybe); our $QP_URL = 'https://xapian.org/docs/queryparser.html'; @@ -171,6 +172,8 @@ sub inbox_config ($$$) { my ($ctx, $hdr, $txt) = @_; my $ibx = $ctx->{ibx}; push @$hdr, 'Content-Disposition', 'inline; filename=inbox.config'; + my $t = eval { $ibx->mm->created_at }; + push(@$hdr, 'Last-Modified', time2str($t)) if $t; my $name = dq_escape($ibx->{name}); my $inboxdir = '/path/to/top-level-inbox'; my $base_url = $ibx->base_url($ctx->{env}); @@ -210,7 +213,8 @@ EOF defined(my $v = $ibx->{$k}) or next; $$txt .= "\t$k = $v\n"; } - $$txt .= "\tnntpmirror = $_\n" for (@{$ibx->nntp_url}); + $$txt .= "\tnntpmirror = $_\n" for (@{$ibx->nntp_url($ctx)}); + $$txt .= "\timapmirror = $_\n" for (@{$ibx->imap_url($ctx)}); _coderepo_config($ctx, $txt); 1; } @@ -342,8 +346,19 @@ EOM Example config snippet for mirrors: $cfg_link EOF + if ($ibx->can('imap_url')) { + my $imap = $ibx->imap_url($ctx); + if (@$imap) { + $$txt .= "\n"; + $$txt .= 'IMAP subfolder(s) available under:'; + $$txt .= "\n\t" . join("\n\t", @$imap) . "\n"; + $$txt .= <can('nntp_url')) { - my $nntp = $ibx->nntp_url; + my $nntp = $ibx->nntp_url($ctx); if (scalar @$nntp) { $$txt .= "\n"; $$txt .= @$nntp == 1 ? 'Newsgroup' : 'Newsgroups are';