about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-04-18 08:25:56 +0000
committerEric Wong <e@80x24.org>2019-04-19 23:57:21 +0000
commit7a3946ef122e8218c6ce3355d7f968562212d53b (patch)
tree76b5011e71edbb37494bf1dcaa4db04f7d9882da /lib/PublicInbox/Inbox.pm
parentf3b60bf095846ce9290b94a7b1d700ed7bf0f316 (diff)
downloadpublic-inbox-7a3946ef122e8218c6ce3355d7f968562212d53b.tar.gz
We will still return a 404 by default to '/' for compatibility
with users of Plack::App::Cascade or similar.  Inboxes are
sorted by modification times to help users detect activity
(similar to the /$INBOX/ topic view).

New configuration options:

* publicinbox.wwwlisting - configure the listing type
* publicinbox.<name>.hide - hide a particular inbox from the listing

See changes to public-inbox-config.pod for full descriptions
of the new options.

Requested-by: Leah Neukirchen <leah@vuxu.org>
  https://public-inbox.org/meta/871sdfzy80.fsf@gmail.com/
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 0d28dd04..286555f6 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -95,6 +95,15 @@ sub new {
         if (defined $dir && -f "$dir/inbox.lock") {
                 $opts->{version} = 2;
         }
+
+        # allow any combination of multi-line or comma-delimited hide entries
+        my $hide = {};
+        if (defined(my $h = $opts->{hide})) {
+                foreach my $v (@$h) {
+                        $hide->{$_} = 1 foreach (split(/\s*,\s*/, $v));
+                }
+                $opts->{-hide} = $hide;
+        }
         bless $opts, $class;
 }