]> 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 a5a429259d97043c198d327a4b137e76b57bddee..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
@@ -55,7 +51,7 @@ class ApiUserFollowersAction extends ApiSubscriptionsAction
      *
      * @return array Profiles
      */
-    function getProfiles()
+    protected function getProfiles()
     {
         $offset = ($this->page - 1) * $this->count;
         $limit =  $this->count + 1;
@@ -63,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
             );
@@ -75,10 +71,8 @@ class ApiUserFollowersAction extends ApiSubscriptionsAction
 
         $profiles = array();
 
-        if (!empty($subs)) {
-            while ($subs->fetch()) {
-                $profiles[] = clone($subs);
-            }
+        while ($subs->fetch()) {
+            $profiles[] = clone($subs);
         }
 
         return $profiles;