Give remote Atom URL for remote profile view
This commit is contained in:
parent
d2c7c83615
commit
75079320d1
@ -113,6 +113,18 @@ class ShowstreamAction extends NoticestreamAction
|
|||||||
$this->target->getNickname(), $this->tag)));
|
$this->target->getNickname(), $this->tag)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->target->isLocal()) {
|
||||||
|
// remote profiles at least have Atom, but we can't guarantee anything else
|
||||||
|
return array(
|
||||||
|
new Feed(Feed::ATOM,
|
||||||
|
$this->target->getAtomFeed(),
|
||||||
|
// TRANS: Title for link to notice feed.
|
||||||
|
// TRANS: %s is a user nickname.
|
||||||
|
sprintf(_('Notice feed for %s (Atom)'),
|
||||||
|
$this->target->getNickname()))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return array(new Feed(Feed::JSON,
|
return array(new Feed(Feed::JSON,
|
||||||
common_local_url('ApiTimelineUser',
|
common_local_url('ApiTimelineUser',
|
||||||
array(
|
array(
|
||||||
@ -139,10 +151,7 @@ class ShowstreamAction extends NoticestreamAction
|
|||||||
sprintf(_('Notice feed for %s (RSS 2.0)'),
|
sprintf(_('Notice feed for %s (RSS 2.0)'),
|
||||||
$this->target->getNickname())),
|
$this->target->getNickname())),
|
||||||
new Feed(Feed::ATOM,
|
new Feed(Feed::ATOM,
|
||||||
common_local_url('ApiTimelineUser',
|
$this->target->getAtomFeed(),
|
||||||
array(
|
|
||||||
'id' => $this->target->getID(),
|
|
||||||
'format' => 'atom')),
|
|
||||||
// TRANS: Title for link to notice feed.
|
// TRANS: Title for link to notice feed.
|
||||||
// TRANS: %s is a user nickname.
|
// TRANS: %s is a user nickname.
|
||||||
sprintf(_('Notice feed for %s (Atom)'),
|
sprintf(_('Notice feed for %s (Atom)'),
|
||||||
|
@ -1618,14 +1618,13 @@ class Profile extends Managed_DataObject
|
|||||||
return !empty($block);
|
return !empty($block);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAtomFeed()
|
public function getAtomFeed()
|
||||||
{
|
{
|
||||||
$feed = null;
|
$feed = null;
|
||||||
|
|
||||||
if (Event::handle('StartProfileGetAtomFeed', array($this, &$feed))) {
|
if (Event::handle('StartProfileGetAtomFeed', array($this, &$feed))) {
|
||||||
$user = User::getKV('id', $this->id);
|
if ($this->isLocal()) {
|
||||||
if (!empty($user)) {
|
$feed = common_local_url('ApiTimelineUser', array('id' => $this->getID(),
|
||||||
$feed = common_local_url('ApiTimelineUser', array('id' => $user->id,
|
|
||||||
'format' => 'atom'));
|
'format' => 'atom'));
|
||||||
}
|
}
|
||||||
Event::handle('EndProfileGetAtomFeed', array($this, $feed));
|
Event::handle('EndProfileGetAtomFeed', array($this, $feed));
|
||||||
|
Loading…
Reference in New Issue
Block a user