X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapiblockdestroy.php;h=7ea201677e677fe2c2e0373153bc9a752db3ef7c;hb=af2158b8b496c992ffb8af07c5d48fff8fdcc06a;hp=328f18ab0dcf1765d688f807160b314ac4ba3dd2;hpb=aa0d9a86152d2485de6de5ec572ae87085ebe780;p=quix0rs-gnu-social.git diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php index 328f18ab0d..7ea201677e 100644 --- a/actions/apiblockdestroy.php +++ b/actions/apiblockdestroy.php @@ -23,7 +23,7 @@ * @package StatusNet * @author Evan Prodromou * @author Zach Copley - * @copyright 2009 StatusNet, Inc. + * @copyright 2009-2010 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -64,7 +64,7 @@ class ApiBlockDestroyAction extends ApiAuthAction parent::prepare($args); $this->user = $this->auth_user; - $this->other = $this->getTargetUser($this->arg('id')); + $this->other = $this->getTargetProfile($this->arg('id')); return true; } @@ -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);