X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fatomusernoticefeed.php;h=fb0ac5f8313c88cd80504cfca650fb393d4a8d8d;hb=3904ab9983942c30ae7209c8c6a3426359a51770;hp=785db4915b9c405be2cee021b4b1378360947ae0;hpb=c6b1e25d1732471f91687cc09ace5face1820b72;p=quix0rs-gnu-social.git diff --git a/lib/atomusernoticefeed.php b/lib/atomusernoticefeed.php index 785db4915b..fb0ac5f831 100644 --- a/lib/atomusernoticefeed.php +++ b/lib/atomusernoticefeed.php @@ -44,7 +44,7 @@ if (!defined('STATUSNET')) */ class AtomUserNoticeFeed extends AtomNoticeFeed { - private $user; + protected $user; /** * Constructor @@ -55,14 +55,33 @@ class AtomUserNoticeFeed extends AtomNoticeFeed * * @return void */ - function __construct($user, $cur = null, $indent = true) { parent::__construct($cur, $indent); $this->user = $user; if (!empty($user)) { + $profile = $user->getProfile(); - $this->addAuthor($profile->nickname, $user->uri); - $this->setActivitySubject($profile->asActivityNoun('subject')); + + $ao = ActivityObject::fromProfile($profile); + + array_push($ao->extra, $profile->profileInfo($cur)); + + // XXX: For users, we generate an author _AND_ an + // This is for backward compatibility with clients (especially + // StatusNet's clients) that assume the Atom will conform to an + // older version of the Activity Streams API. Subject should be + // removed in future versions of StatusNet. + + $this->addAuthorRaw($ao->asString('author')); + + $depMsg = 'Deprecation warning: activity:subject is present ' + . 'only for backward compatibility. It will be ' + . 'removed in the next version of StatusNet.'; + + $this->addAuthorRaw( + "\n" + . $ao->asString('activity:subject') + ); } // TRANS: Title in atom user notice feed. %s is a user name. @@ -90,7 +109,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed array('nickname' => $user->nickname) ) ); - + $self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));