Give priority to ATOM to expose WebSub.

Hello,
The ATOM feed contains the hub declaration for WebSub / PubSubHubbub, but the RSS / RDF / JSON versions do not.
Currently, the ATOM version is declared last.
RSS/ATOM clients typically pick whichever version comes first, and will thus not see the WebSub feature.
I therefore suggest putting the ATOM version first, as it is more feature-rich than the other versions.

Clients not compatible with ATOM would not pick it anyway due to the different type attribute.

See same PR for Mastodon: https://github.com/tootsuite/mastodon/pull/9302
and WebSub tester https://websub.rocks/publisher
This commit is contained in:
Alexandre Alapetite 2018-11-20 22:39:23 +00:00
parent b3c3af1ef6
commit e473937cb9

View File

@ -97,7 +97,12 @@ class PublicAction extends SitestreamAction
*/ */
function getFeeds() function getFeeds()
{ {
return array(new Feed(Feed::JSON, return array(new Feed(Feed::ATOM,
common_local_url('ApiTimelinePublic',
array('format' => 'atom')),
// TRANS: Link description for public timeline feed.
_('Public Timeline Feed (Atom)')),
new Feed(Feed::JSON,
common_local_url('ApiTimelinePublic', common_local_url('ApiTimelinePublic',
array('format' => 'as')), array('format' => 'as')),
// TRANS: Link description for public timeline feed. // TRANS: Link description for public timeline feed.
@ -109,11 +114,6 @@ class PublicAction extends SitestreamAction
common_local_url('ApiTimelinePublic', common_local_url('ApiTimelinePublic',
array('format' => 'rss')), array('format' => 'rss')),
// TRANS: Link description for public timeline feed. // TRANS: Link description for public timeline feed.
_('Public Timeline Feed (RSS 2.0)')), _('Public Timeline Feed (RSS 2.0)')));
new Feed(Feed::ATOM,
common_local_url('ApiTimelinePublic',
array('format' => 'atom')),
// TRANS: Link description for public timeline feed.
_('Public Timeline Feed (Atom)')));
} }
} }