add activitystreams links to other actions

This commit is contained in:
Evan Prodromou 2011-06-22 17:19:46 -04:00
parent e5d8fd6857
commit 0755f45bf0
7 changed files with 63 additions and 6 deletions

View File

@ -99,6 +99,15 @@ class AllAction extends ProfileAction
function getFeeds()
{
return array(
new Feed(Feed::JSON,
common_local_url(
'ApiTimelineFriends', array(
'format' => 'as',
'id' => $this->user->nickname
)
),
// TRANS: %s is user nickname.
sprintf(_('Feed for friends of %s (Activity Streams JSON)'), $this->user->nickname)),
new Feed(Feed::RSS1,
common_local_url(
'allrss', array(

View File

@ -162,7 +162,12 @@ class PublicAction extends Action
*/
function getFeeds()
{
return array(new Feed(Feed::RSS1, common_local_url('publicrss'),
return array(new Feed(Feed::JSON,
common_local_url('ApiTimelinePublic',
array('format' => 'as')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (Activity Streams JSON)')),
new Feed(Feed::RSS1, common_local_url('publicrss'),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 1.0)')),
new Feed(Feed::RSS2,

View File

@ -143,7 +143,16 @@ class RepliesAction extends Action
*/
function getFeeds()
{
return array(new Feed(Feed::RSS1,
return array(new Feed(Feed::JSON,
common_local_url('ApiTimelineMentions',
array(
'id' => $this->user->nickname,
'format' => 'as')),
// TRANS: Link for feed with replies for a user.
// TRANS: %s is a user nickname.
sprintf(_('Replies feed for %s (Activity Streams JSON)'),
$this->user->nickname)),
new Feed(Feed::RSS1,
common_local_url('repliesrss',
array('nickname' => $this->user->nickname)),
// TRANS: Link for feed with replies for a user.

View File

@ -165,7 +165,15 @@ class ShowfavoritesAction extends Action
*/
function getFeeds()
{
return array(new Feed(Feed::RSS1,
return array(new Feed(Feed::JSON,
common_local_url('ApiTimelineFavorites',
array(
'id' => $this->user->nickname,
'format' => 'as')),
// TRANS: Feed link text. %s is a username.
sprintf(_('Feed for favorites of %s (Activity Streams JSON)'),
$this->user->nickname)),
new Feed(Feed::RSS1,
common_local_url('favoritesrss',
array('nickname' => $this->user->nickname)),
// TRANS: Feed link text. %s is a username.

View File

@ -220,7 +220,14 @@ class ShowgroupAction extends Action
common_local_url('grouprss',
array('nickname' => $this->group->nickname));
return array(new Feed(Feed::RSS1,
return array(new Feed(Feed::JSON,
common_local_url('ApiTimelineGroup',
array('format' => 'as',
'id' => $this->group->id)),
// TRANS: Tooltip for feed link. %s is a group nickname.
sprintf(_('Notice feed for %s group (Activity Streams JSON)'),
$this->group->nickname)),
new Feed(Feed::RSS1,
common_local_url('grouprss',
array('nickname' => $this->group->nickname)),
// TRANS: Tooltip for feed link. %s is a group nickname.

View File

@ -169,7 +169,18 @@ class ShowprofiletagAction extends Action
function getFeeds()
{
#XXX: make these actually work
return array(new Feed(Feed::RSS2,
return array(new Feed(Feed::JSON,
common_local_url(
'ApiTimelineList', array(
'user' => $this->tagger->id,
'id' => $this->peopletag->id,
'format' => 'as'
)
),
// TRANS: Feed title.
// TRANS: %s is tagger's nickname.
sprintf(_('Feed for friends of %s (Activity Streams JSON)'), $this->tagger->nickname)),
new Feed(Feed::RSS2,
common_local_url(
'ApiTimelineList', array(
'user' => $this->tagger->id,

View File

@ -79,7 +79,15 @@ class TagAction extends Action
function getFeeds()
{
return array(new Feed(Feed::RSS1,
return array(new Feed(Feed::JSON,
common_local_url('ApiTimelineTag',
array('format' => 'as',
'tag' => $this->tag)),
// TRANS: Link label for feed on "notices with tag" page.
// TRANS: %s is the tag the feed is for.
sprintf(_('Notice feed for tag %s (Activity Streams JSON)'),
$this->tag)),
new Feed(Feed::RSS1,
common_local_url('tagrss',
array('tag' => $this->tag)),
// TRANS: Link label for feed on "notices with tag" page.