]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apiuserfollowers.php
Merge branch 'group-join-approve-reject-button-icons' into 'nightly'
[quix0rs-gnu-social.git] / actions / apiuserfollowers.php
index e8d92a773e17895b51d695a37c2fe9036a58cf45..ebad0e5e813c059ac5496dbea801ef1ea63bfc3d 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
-
-require_once INSTALLDIR . '/lib/apibareauth.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Ouputs the authenticating user's followers (subscribers), each with
@@ -48,7 +44,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
 class ApiUserFollowersAction extends ApiSubscriptionsAction
 {
     /**
@@ -56,8 +51,7 @@ class ApiUserFollowersAction extends ApiSubscriptionsAction
      *
      * @return array Profiles
      */
-
-    function getProfiles()
+    protected function getProfiles()
     {
         $offset = ($this->page - 1) * $this->count;
         $limit =  $this->count + 1;
@@ -65,11 +59,11 @@ class ApiUserFollowersAction extends ApiSubscriptionsAction
         $subs = null;
 
         if (isset($this->tag)) {
-            $subs = $this->user->getTaggedSubscribers(
+            $subs = $this->target->getTaggedSubscribers(
                 $this->tag, $offset, $limit
             );
         } else {
-            $subs = $this->user->getSubscribers(
+            $subs = $this->target->getSubscribers(
                 $offset,
                 $limit
             );
@@ -77,13 +71,10 @@ class ApiUserFollowersAction extends ApiSubscriptionsAction
 
         $profiles = array();
 
-        if (!empty($subs)) {
-            while ($subs->fetch()) {
-                $profiles[] = clone($subs);
-            }
+        while ($subs->fetch()) {
+            $profiles[] = clone($subs);
         }
 
         return $profiles;
     }
-
 }