Stop using <activity:subject> for atom feeds

This commit is contained in:
Evan Prodromou 2010-12-27 10:03:34 -08:00
parent f5128015be
commit ab92496ddc
5 changed files with 8 additions and 12 deletions

View File

@ -125,10 +125,6 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
header('Content-Type: application/atom+xml; charset=utf-8');
try {
$atom->addAuthorRaw($this->group->asAtomAuthor());
$atom->setActivitySubject($this->group->asActivitySubject());
$atom->setId($self);
$atom->setSelfLink($self);
$atom->addEntryFromNotices($this->notices);
$this->raw($atom->getString());
} catch (Atom10FeedException $e) {

View File

@ -146,15 +146,16 @@ class Atom10Feed extends XMLStringer
}
/**
* Add a activity feed subject via raw XML string
* Deprecated <activity:subject>; ignored
*
* @param string $xmlSubject An XML string representation of the subject
*
* @return void
*/
function setActivitySubject($xmlSubject)
{
$this->subject = $xmlSubject;
throw new ServerException(_('Don\'t use this method!'));
}
function getNamespaces()

View File

@ -85,8 +85,9 @@ class AtomGroupNoticeFeed extends AtomNoticeFeed
$this->setId($self);
$this->setSelfLink($self);
$this->addAuthorRaw($group->asAtomAuthor());
$this->setActivitySubject($group->asActivitySubject());
$ao = ActivityObject::fromGroup($group);
$this->addAuthorRaw($ao->asString('author'));
$this->addLink($group->homeUrl());
}

View File

@ -60,8 +60,8 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
$this->user = $user;
if (!empty($user)) {
$profile = $user->getProfile();
$this->addAuthor($profile->nickname, $user->uri);
$this->setActivitySubject($profile->asActivityNoun('subject'));
$ao = ActivityObject::fromProfile($profile);
$this->addAuthorRaw($ao->asString('author'));
}
// TRANS: Title in atom user notice feed. %s is a user name.

View File

@ -145,12 +145,10 @@ class OStatusPlugin extends Plugin
$user = $feed->getUser();
$id = $user->id;
$profile = $user->getProfile();
$feed->setActivitySubject($profile->asActivityNoun('subject'));
} else if ($feed instanceof AtomGroupNoticeFeed) {
$salmonAction = 'groupsalmon';
$group = $feed->getGroup();
$id = $group->id;
$feed->setActivitySubject($group->asActivitySubject());
} else {
return true;
}