]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifriendshipscreate.php
debug output when saving new mapping
[quix0rs-gnu-social.git] / actions / apifriendshipscreate.php
index 6c44d79610a31e5e7fd2fb55dced3c591dda91c8..a7ec5b28a44452996e666d60c36ce72075fc400b 100644 (file)
  *
  * @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.
+ * @copyright 2009-2010 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/
  */
@@ -31,7 +33,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/apiauth.php';
+require_once INSTALLDIR . '/lib/apiauth.php';
 
 /**
  * Allows the authenticating users to follow (subscribe) the user specified in
@@ -40,6 +42,8 @@ require_once INSTALLDIR.'/lib/apiauth.php';
  *
  * @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/
@@ -47,7 +51,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
 
 class ApiFriendshipsCreateAction extends ApiAuthAction
 {
-    var $user   = null;
     var $other  = null;
 
     /**
@@ -64,7 +67,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
         parent::prepare($args);
 
         $this->user   = $this->auth_user;
-        $this->other  = $this->getTargetUser($id);
+        $this->other  = $this->getTargetProfile($this->arg('id'));
 
         return true;
     }
@@ -94,7 +97,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
 
         if (!in_array($this->format, array('xml', 'json'))) {
             $this->clientError(
-                _('API method not found!'),
+                _('API method not found.'),
                 404,
                 $this->format
             );
@@ -103,7 +106,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
 
         if (empty($this->other)) {
             $this->clientError(
-                _('Could not follow user: User not found.'),
+                _('Could not follow user: profile not found.'),
                 403,
                 $this->format
             );