Revert "Revert "Show <activity:subject> and no activity actors for user feed""

This reverts commit e2578cfad6.
This commit is contained in:
Zach Copley 2010-03-03 17:35:18 -08:00
parent b97ac60209
commit f210cadfec
3 changed files with 29 additions and 6 deletions

View File

@ -1106,7 +1106,7 @@ class Notice extends Memcached_DataObject
return $groups; return $groups;
} }
function asAtomEntry($namespace=false, $source=false) function asAtomEntry($namespace=false, $source=false, $author=true)
{ {
$profile = $this->getProfile(); $profile = $this->getProfile();
@ -1151,8 +1151,10 @@ class Notice extends Memcached_DataObject
$xs->element('title', null, $this->content); $xs->element('title', null, $this->content);
if ($author) {
$xs->raw($profile->asAtomAuthor()); $xs->raw($profile->asAtomAuthor());
$xs->raw($profile->asActivityActor()); $xs->raw($profile->asActivityActor());
}
$xs->element('link', array('rel' => 'alternate', $xs->element('link', array('rel' => 'alternate',
'type' => 'text/html', 'type' => 'text/html',

View File

@ -107,9 +107,19 @@ class AtomNoticeFeed extends Atom10Feed
*/ */
function addEntryFromNotice($notice) function addEntryFromNotice($notice)
{ {
$this->addEntryRaw($notice->asAtomEntry()); $source = $this->showSource();
$author = $this->showAuthor();
$this->addEntryRaw($notice->asAtomEntry(false, $source, $author));
} }
function showSource()
{
return true;
}
function showAuthor()
{
return true;
}
} }

View File

@ -61,6 +61,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
if (!empty($user)) { if (!empty($user)) {
$profile = $user->getProfile(); $profile = $user->getProfile();
$this->addAuthor($profile->nickname, $user->uri); $this->addAuthor($profile->nickname, $user->uri);
$this->setActivitySubject($profile->asActivityNoun('subject'));
} }
$title = sprintf(_("%s timeline"), $user->nickname); $title = sprintf(_("%s timeline"), $user->nickname);
@ -105,4 +106,14 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
{ {
return $this->user; return $this->user;
} }
function showSource()
{
return false;
}
function showAuthor()
{
return false;
}
} }