]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinefriends.php
use small triangle for notice addressees
[quix0rs-gnu-social.git] / actions / apitimelinefriends.php
index 0e356bb18be2bc08ba7eea5441b12fc32778ae3f..279265a30ee55a94e30daaf41ba06baea8822d3f 100644 (file)
@@ -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);