]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Change to more recent code style in ApiStatusesDestroyAction
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 28 Feb 2016 18:23:13 +0000 (19:23 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 28 Feb 2016 18:23:13 +0000 (19:23 +0100)
actions/apistatusesdestroy.php

index f681ee8419c3f81906449a5acbb3bdf03f1d6389..2c4edbcfa499da301a8a81d28678c651da9af71e 100644 (file)
@@ -68,8 +68,6 @@ class ApiStatusesDestroyAction extends ApiAuthAction
     {
         parent::prepare($args);
 
-        $this->user = $this->auth_user;
-        $this->profile = $this->auth_user->getProfile();        
         $this->notice_id = (int)$this->trimmed('id');
 
         if (empty($notice_id)) {
@@ -123,10 +121,10 @@ class ApiStatusesDestroyAction extends ApiAuthAction
             return;
         }
 
-        if ($this->user->id == $this->notice->profile_id || $this->profile->hasRight(Right::DELETEOTHERSNOTICE)) {
-            if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
+        if ($this->scoped->sameAs($this->notice->getProfile()) || $this->scoped->hasRight(Right::DELETEOTHERSNOTICE)) {
+            if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) {
                 $this->notice->deleteAs($this->scoped);
-                Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
+                Event::handle('EndDeleteOwnNotice', array($this->auth_user, $this->notice));
             }
                $this->showNotice();
         } else {