ostatus:attention links in Notice Atom output

This commit is contained in:
Zach Copley 2010-02-11 15:24:18 -08:00
parent 8e6b52e899
commit 3beddffc39
2 changed files with 21 additions and 1 deletions

View File

@ -994,7 +994,7 @@ class Notice extends Memcached_DataObject
$xs->element('summary', null, $this->content);
$xs->raw($profile->asAtomAuthor());
$xs->raw($profile->asActivityActor($namespace));
$xs->raw($profile->asActivityActor());
$xs->element('link', array('rel' => 'alternate',
'href' => $this->bestUrl()));
@ -1028,6 +1028,20 @@ class Notice extends Memcached_DataObject
);
}
$reply_ids = $this->getReplies();
foreach ($reply_ids as $id) {
$profile = Profile::staticGet('id', $id);
if (!empty($profile)) {
$xs->element(
'link', array(
'rel' => 'osatus:attention',
'href' => $profile->getAcctUri()
)
);
}
}
if (!empty($this->repeat_of)) {
$repeat = Notice::staticGet('id', $this->repeat_of);
if (!empty($repeat)) {

View File

@ -803,4 +803,10 @@ class Profile extends Memcached_DataObject
return $xs->getString();
}
function getAcctUri()
{
return $this->nickname . '@' . common_config('site', 'server');
}
}