From 446c930823136f1df5d0d86f135548a1aed3357c Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 28 Feb 2016 19:23:13 +0100 Subject: [PATCH] Change to more recent code style in ApiStatusesDestroyAction --- actions/apistatusesdestroy.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 { -- 2.39.5