From 2ae04bb6d598c74763aca79ab52172934158be46 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 28 Dec 2009 10:50:12 -0800 Subject: add events for unblocking a profile --- actions/apiblockdestroy.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'actions/apiblockdestroy.php') 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); -- cgit v1.2.3-54-g00ecf