X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapifriendshipsexists.php;h=c040b9f6ad87edc455137432ca0d90d6774440fc;hb=68a2e46390092f034101bf1a1c9fc4a5ecc41b06;hp=df9f0c949c9cd1596c23bad984999e32a156e568;hpb=57dfad64beae100187dcaf3c205645e89611e115;p=quix0rs-gnu-social.git diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php index df9f0c949c..c040b9f6ad 100644 --- a/actions/apifriendshipsexists.php +++ b/actions/apifriendshipsexists.php @@ -21,6 +21,8 @@ * * @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 @@ -31,20 +33,22 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/apiprivateauth.php'; /** - * Tests for the existence of friendship between two users. Will return true if + * Tests for the existence of friendship between two users. Will return true if * user_a follows user_b, otherwise will return false. * * @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 ApiFriendshipsExistsAction extends ApiAction +class ApiFriendshipsExistsAction extends ApiPrivateAuthAction { var $user_a = null; var $user_b = null; @@ -65,16 +69,7 @@ class ApiFriendshipsExistsAction extends ApiAction $user_a_id = $this->trimmed('user_a'); $user_b_id = $this->trimmed('user_b'); - common_debug("user_a = " . $user_a_id); - common_debug("user_b = " . $user_b_id); - - $this->user_a = $this->getTargetUser($user_a_id); - - if (empty($this->user_a)) { - common_debug('gargargra'); - } - $this->user_b = $this->getTargetUser($user_b_id); return true; @@ -107,14 +102,14 @@ class ApiFriendshipsExistsAction extends ApiAction switch ($this->format) { case 'xml': - $this->init_document('xml'); + $this->initDocument('xml'); $this->element('friends', null, $result); - $this->end_document('xml'); + $this->endDocument('xml'); break; case 'json': - $this->init_document('json'); + $this->initDocument('json'); print json_encode($result); - $this->end_document('json'); + $this->endDocument('json'); break; default: break;