]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apistatusesdestroy.php
Merged
[quix0rs-gnu-social.git] / actions / apistatusesdestroy.php
index d73e574b3c1c095b039c03ed528c0902248d3402..e1783f258ac5728f7936e827b0678c0377047cad 100644 (file)
@@ -38,8 +38,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Deletes one of the authenticating user's statuses (notices).
  *
@@ -66,7 +64,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -77,7 +75,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
             $this->notice_id = (int)$this->arg('id');
         }
 
-        $this->notice = Notice::staticGet((int)$this->notice_id);
+        $this->notice = Notice::getKV((int)$this->notice_id);
 
         return true;
      }
@@ -91,13 +89,13 @@ class ApiStatusesDestroyAction extends ApiAuthAction
      *
      * @return void
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
         if (!in_array($this->format, array('xml', 'json'))) {
             $this->clientError(
-                // TRANS: Client error displayed trying to execute an unknown API method deleting a status.
+                // TRANS: Client error displayed when coming across a non-supported API method.
                 _('API method not found.'),
                 404
             );
@@ -126,7 +124,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
 
         if ($this->user->id == $this->notice->profile_id) {
             if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
-                $this->notice->delete();
+                $this->notice->deleteAs($this->scoped);
                 Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
             }
                $this->showNotice();