X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelinefriends.php;h=279265a30ee55a94e30daaf41ba06baea8822d3f;hb=cb6b5b2cc6197091b9d831ffeec695cf5ab8713a;hp=0e356bb18be2bc08ba7eea5441b12fc32778ae3f;hpb=5519da95fdadf61828b2ed5d8a89f59ed79fdff0;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php index 0e356bb18b..279265a30e 100644 --- a/actions/apitimelinefriends.php +++ b/actions/apitimelinefriends.php @@ -204,6 +204,8 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction $profile = $this->user->getProfile(); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $sitename = common_config('site', 'name'); + // TRANS: Title of API timeline for a user and friends. + // TRANS: %s is a username. $title = sprintf(_("%s and friends"), $this->user->nickname); $taguribase = TagURI::base(); $id = "tag:$taguribase:FriendsTimeline:" . $this->user->id; @@ -272,7 +274,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction $this->raw($doc->asString()); break; default: - // TRANS: Client error displayed when trying to handle an unknown API method. + // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), $code = 404); break; } @@ -287,15 +289,12 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction { $notices = array(); - if (!empty($this->auth_user) && $this->auth_user->id == $this->user->id) { - $notice = $this->user->ownFriendsTimeline(($this->page-1) * $this->count, - $this->count, $this->since_id, - $this->max_id); - } else { - $notice = $this->user->friendsTimeline(($this->page-1) * $this->count, - $this->count, $this->since_id, - $this->max_id); - } + $stream = new InboxNoticeStream($this->user); + + $notice = $stream->getNotices(($this->page-1) * $this->count, + $this->count, + $this->since_id, + $this->max_id); while ($notice->fetch()) { $notices[] = clone($notice);