]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifriendshipsexists.php
Merge branch 'testing'
[quix0rs-gnu-social.git] / actions / apifriendshipsexists.php
index 93be5f84ea2587d79f369e1812f49e28229ef79f..ca62b5f51420b81009d766bdebb30e6fd17d359d 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,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 <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 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;
@@ -121,4 +116,19 @@ class ApiFriendshipsExistsAction extends ApiAction
         }
     }
 
+    /**
+     * Return true if read only.
+     *
+     * MAY override
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean is read only action?
+     */
+
+    function isReadOnly($args)
+    {
+        return true;
+    }
+
 }