summaryrefslogtreecommitdiff
path: root/actions/apiblockcreate.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/apiblockcreate.php')
-rw-r--r--actions/apiblockcreate.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php
index e79dec32d..c26485f59 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);