X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiuserfriends.php;h=89a90239a1bbc267a6ac65b9f65f20c1fb4d123e;hb=1eff108561bf395010a05dd490c0f4070c192c16;hp=b77d08097c2171d012ac1657d56d1a8624fa4f15;hpb=c4b8f68a1a3ed6422a2ed1cb7a8b5b5c65011b5f;p=quix0rs-gnu-social.git diff --git a/actions/apiuserfriends.php b/actions/apiuserfriends.php index b77d08097c..89a90239a1 100644 --- a/actions/apiuserfriends.php +++ b/actions/apiuserfriends.php @@ -29,11 +29,7 @@ * @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 friends (subscriptions), each with @@ -55,7 +51,7 @@ class ApiUserFriendsAction 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 ApiUserFriendsAction extends ApiSubscriptionsAction $subs = null; if (isset($this->tag)) { - $subs = $this->user->getTaggedSubscriptions( + $subs = $this->target->getTaggedSubscriptions( $this->tag, $offset, $limit ); } else { - $subs = $this->user->getSubscriptions( + $subs = $this->target->getSubscribed( $offset, $limit ); @@ -75,10 +71,8 @@ class ApiUserFriendsAction extends ApiSubscriptionsAction $profiles = array(); - if (!empty($subs)) { - while ($subs->fetch()) { - $profiles[] = clone($subs); - } + while ($subs->fetch()) { + $profiles[] = clone($subs); } return $profiles;