forked from GNUsocial/gnu-social
Stop using <activity:subject> for atom feeds
This commit is contained in:
parent
f5128015be
commit
ab92496ddc
@ -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) {
|
||||
|
@ -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()
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user