X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiuserfriends.php;h=89a90239a1bbc267a6ac65b9f65f20c1fb4d123e;hb=c04c91bb8974671ee093f444b3d180993bc4987c;hp=8a42e36b98ccca3da91b372b831c4baf3f5c5bd2;hpb=4e1b95db283285f1ae0668745a151a6fdb5171eb;p=quix0rs-gnu-social.git diff --git a/actions/apiuserfriends.php b/actions/apiuserfriends.php index 8a42e36b98..89a90239a1 100644 --- a/actions/apiuserfriends.php +++ b/actions/apiuserfriends.php @@ -21,17 +21,15 @@ * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @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 @@ -40,11 +38,12 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Dan Moore + * @author Evan Prodromou * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApiUserFriendsAction extends ApiSubscriptionsAction { /** @@ -52,8 +51,7 @@ class ApiUserFriendsAction extends ApiSubscriptionsAction * * @return array Profiles */ - - function getProfiles() + protected function getProfiles() { $offset = ($this->page - 1) * $this->count; $limit = $this->count + 1; @@ -61,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 ); @@ -73,13 +71,10 @@ class ApiUserFriendsAction extends ApiSubscriptionsAction $profiles = array(); - if (!empty($subs)) { - while ($subs->fetch()) { - $profiles[] = clone($subs); - } + while ($subs->fetch()) { + $profiles[] = clone($subs); } return $profiles; } - }