X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapitimelineuser.php;h=11431a82ca9231658ccf0ea8d82ec693905354e3;hb=f85fc944b7ca3d2faaa7b7451068e37f2c5b68a7;hp=ed9104905de1f316c1066df4a9fdbf3332e5836f;hpb=3d0bc1a3dd16826bf89286f37aa3778e93a34b6b;p=quix0rs-gnu-social.git diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index ed9104905d..11431a82ca 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -112,21 +112,17 @@ class ApiTimelineUserAction extends ApiBareAuthAction function showTimeline() { $profile = $this->user->getProfile(); - $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - $sitename = common_config('site', 'name'); - $title = sprintf(_("%s timeline"), $this->user->nickname); - $taguribase = common_config('integration', 'taguri'); - $id = "tag:$taguribase:UserTimeline:" . $this->user->id; - $link = common_local_url( + // We'll use the shared params from the Atom stub + // for other feed types. + $atom = new AtomUserNoticeFeed($this->user); + + $link = common_local_url( 'showstream', array('nickname' => $this->user->nickname) ); - $subtitle = sprintf( - _('Updates from %1$s on %2$s!'), - $this->user->nickname, $sitename - ); - $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE); + + $self = $this->getSelfUri(); // FriendFeed's SUP protocol // Also added RSS and Atom feeds @@ -140,24 +136,24 @@ class ApiTimelineUserAction extends ApiBareAuthAction break; case 'rss': $this->showRssTimeline( - $this->notices, $title, $link, - $subtitle, $suplink, $logo + $this->notices, + $atom->title, + $link, + $atom->subtitle, + $suplink, + $atom->logo, + $self ); break; case 'atom': - $id = $this->arg('id'); - if ($id) { - $selfuri = common_root_url() . - 'api/statuses/user_timeline/' . - rawurlencode($id) . '.atom'; - } else { - $selfuri = common_root_url() . - 'api/statuses/user_timeline.atom'; - } - $this->showAtomTimeline( - $this->notices, $title, $id, $link, - $subtitle, $suplink, $selfuri, $logo - ); + + header('Content-Type: application/atom+xml; charset=utf-8'); + + $atom->setId($self); + $atom->setSelfLink($self); + $atom->addEntryFromNotices($this->notices); + $this->raw($atom->getString()); + break; case 'json': $this->showJsonTimeline($this->notices); @@ -181,7 +177,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction $notice = $this->user->getNotices( ($this->page-1) * $this->count, $this->count, - $this->since_id, $this->max_id, $this->since + $this->since_id, $this->max_id ); while ($notice->fetch()) {