about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-01 08:55:23 +0000
committerEric Wong <e@80x24.org>2015-09-01 08:56:04 +0000
commitd44ed46ee92c78aaaed64975c4d6846613963be4 (patch)
tree0a7546dc1b8b375e49fbca495f7077535dc464c0 /lib/PublicInbox/WWW.pm
parent864dc1c4c61d240651a9f48983e0bf00147a3953 (diff)
downloadpublic-inbox-d44ed46ee92c78aaaed64975c4d6846613963be4.tar.gz
This allows users to subscribe to only a single thread
with their feed reader without subscribing to the rest of
the thread.

Update our endpoint notes while we're at it.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index e6eec3d6..c99c25f8 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -56,6 +56,9 @@ sub run {
                 invalid_list_mid(\%ctx, $1, $2) ||
                         get_thread_mbox(\%ctx, $sfx);
 
+        } elsif ($path_info =~ m!$LISTNAME_RE/t/(\S+)/atom\z!o) {
+                invalid_list_mid(\%ctx, $1, $2) || get_thread_atom(\%ctx);
+
         # legacy redirects
         } elsif ($path_info =~ m!$LISTNAME_RE/(t|m|f)/(\S+)\.html\z!o) {
                 my $pfx = $2;
@@ -348,4 +351,14 @@ sub get_thread_mbox {
         PublicInbox::Mbox::thread_mbox($ctx, $srch, $sfx);
 }
 
+
+# /$LISTNAME/t/$MESSAGE_ID/atom                  -> thread as Atom feed
+sub get_thread_atom {
+        my ($ctx) = @_;
+        searcher($ctx) or return need_search($ctx);
+        $ctx->{self_url} = self_url($ctx->{cgi});
+        require PublicInbox::Feed;
+        PublicInbox::Feed::generate_thread_atom($ctx);
+}
+
 1;