]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifriendshipsdestroy.php
Lots of tiny message changes.
[quix0rs-gnu-social.git] / actions / apifriendshipsdestroy.php
index ef864c4db84d721a9e5f372ba65a2d4480e4206e..91c6fd032439e7bdc68c621fec5bcb64458ec4c1 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,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 unfollow (unsubscribe) 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,9 +51,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
 
 class ApiFriendshipsDestroyAction extends ApiAuthAction
 {
-
-    var $format = null;
-    var $user   = null;
     var $other  = null;
 
     /**
@@ -65,13 +66,6 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
     {
         parent::prepare($args);
 
-        if ($this->requiresAuth()) {
-            if ($this->checkBasicAuthUser() == false) {
-                return;
-            }
-        }
-
-        $this->format = $this->arg('format');
         $this->user   = $this->auth_user;
         $this->other  = $this->getTargetUser($id);
 
@@ -103,7 +97,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
 
         if (!in_array($this->format, array('xml', 'json'))) {
             $this->clientError(
-                _('API method not found!'),
+                _('API method not found.'),
                 404,
                 $this->format
             );
@@ -123,7 +117,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
 
         if ($this->user->id == $this->other->id) {
             $this->clientError(
-                _("You cannot unfollow yourself!"),
+                _("You cannot unfollow yourself."),
                 403,
                 $this->format
             );
@@ -137,9 +131,9 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
             return;
         }
 
-        $this->init_document($this->format);
-        $this->show_profile($this->other, $this->format);
-        $this->end_document($this->format);
+        $this->initDocument($this->format);
+        $this->showProfile($this->other, $this->format);
+        $this->endDocument($this->format);
     }
 
 }