summaryrefslogtreecommitdiff
path: root/actions/apiblockdestroy.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-28 10:50:12 -0800
committerEvan Prodromou <evan@status.net>2009-12-28 10:50:12 -0800
commit2ae04bb6d598c74763aca79ab52172934158be46 (patch)
treed196dfb1fa6abe39ccaeff551f5ffe5f5bf1d804 /actions/apiblockdestroy.php
parentc5de3262312f814bc44e596d9031c2df22420e27 (diff)
add events for unblocking a profile
Diffstat (limited to 'actions/apiblockdestroy.php')
-rw-r--r--actions/apiblockdestroy.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php
index 328f18ab0..666f308f4 100644
--- a/actions/apiblockdestroy.php
+++ b/actions/apiblockdestroy.php
@@ -97,9 +97,16 @@ class ApiBlockDestroyAction extends ApiAuthAction
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);