X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiblockcreate.php;h=c26485f591b23196917eb07f3fcc8b65e6ab72d3;hb=5cc1f8b001057e9c4301b173391a7f0a5415f153;hp=e79dec32d0521ced06d3da89c6a4226ac05e89d0;hpb=4afe07f0c3ab20d4007e94f9e4e9b35629b5f63e;p=quix0rs-gnu-social.git diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php index e79dec32d0..c26485f591 100644 --- a/actions/apiblockcreate.php +++ b/actions/apiblockcreate.php @@ -109,9 +109,16 @@ class ApiBlockCreateAction extends ApiAuthAction return; } - if ($this->user->hasBlocked($this->other) - || $this->user->block($this->other) - ) { + if (!$this->user->hasBlocked($this->other)) { + if (Event::handle('StartBlockProfile', array($this->user, $this->other))) { + $result = $this->user->block($this->other); + if ($result) { + Event::handle('EndBlockProfile', 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);