]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifriendshipsexists.php
Make page titles more consistent: no title case in four cases.
[quix0rs-gnu-social.git] / actions / apifriendshipsexists.php
index d1d5d520fcf058485660bbd3946d599867029ea3..c040b9f6ad87edc455137432ca0d90d6774440fc 100644 (file)
@@ -21,6 +21,8 @@
  *
  * @category  API
  * @package   StatusNet
+ * @author    Dan Moore <dan@moore.cx>
+ * @author    Evan Prodromou <evan@status.net>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@@ -31,23 +33,23 @@ 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 <dan@moore.cx>
+ * @author   Evan Prodromou <evan@status.net>
  * @author   Zach Copley <zach@status.net>
  * @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 TwitterApiAction
+class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
 {
-
-    var $format = null;
     var $user_a = null;
     var $user_b = null;
 
@@ -64,21 +66,10 @@ class ApiFriendshipsExistsAction extends TwitterApiAction
     {
         parent::prepare($args);
 
-        $this->format = $this->arg('format');
-
         $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;
@@ -111,14 +102,14 @@ class ApiFriendshipsExistsAction extends TwitterApiAction
 
         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;