From: Mikael Nordfeldth Date: Sun, 28 Feb 2016 18:23:13 +0000 (+0100) Subject: Change to more recent code style in ApiStatusesDestroyAction X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=446c930823136f1df5d0d86f135548a1aed3357c;p=quix0rs-gnu-social.git Change to more recent code style in ApiStatusesDestroyAction --- diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index f681ee8419..2c4edbcfa4 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -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 {