X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiblockdestroy.php;h=666f308f4c5a3819ce1c83ff35e9fb9620c4b5d2;hb=54d2ed8b057025dee2ea8f531c6371e1008f4b89;hp=16dbf94caf5204a8e1f7a97c604d612e90bbdea4;hpb=61419038e5747886357964a7eb3f814761482891;p=quix0rs-gnu-social.git diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 16dbf94caf..666f308f4c 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -93,13 +93,20 @@ class ApiBlockDestroyAction extends ApiAuthAction } if (empty($this->user) || empty($this->other)) { - $this->clientError(_('No such user!'), 404, $this->format); + $this->clientError(_('No such user.'), 404, $this->format); return; } - if (!$this->user->hasBlocked($this->other) - || $this->user->unblock($this->other) - ) { + if ($this->user->hasBlocked($this->other)) { + if (Event::handle('StartUnblockProfile', array($this->user, $this->other))) { + $result = $this->user->unblock($this->other); + if ($result) { + Event::handle('EndUnblockProfile', array($this->user, $this->other)); + } + } + } + + if (!$this->user->hasBlocked($this->other)) { $this->initDocument($this->format); $this->showProfile($this->other, $this->format); $this->endDocument($this->format);