X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Funblock.php;h=1f4d9606b85a7da875dc6ccf030feab2bc72c1ca;hb=0dbdcf2936a00282114f1368ead2f5edebc6ae61;hp=c60458cd3ca810486714a1ea184e30d06cd51f45;hpb=ff88ef407a344749c02d9d1d0dc104b4b720d7ae;p=quix0rs-gnu-social.git diff --git a/actions/unblock.php b/actions/unblock.php index c60458cd3c..1f4d9606b8 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class UnblockAction extends ProfileFormAction { function prepare($args) @@ -56,6 +55,7 @@ class UnblockAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasBlocked($this->profile)) { + // TRANS: Client error displayed when trying to unblock a non-blocked user. $this->clientError(_("You haven't blocked that user.")); return false; } @@ -68,12 +68,21 @@ class UnblockAction extends ProfileFormAction * * @return void */ - function handlePost() { - $cur = common_current_user(); - $result = $cur->unblock($this->profile); + $cur = common_current_user(); + + $result = false; + + if (Event::handle('StartUnblockProfile', array($cur, $this->profile))) { + $result = $cur->unblock($this->profile); + if ($result) { + Event::handle('EndUnblockProfile', array($cur, $this->profile)); + } + } + if (!$result) { + // TRANS: Server error displayed when removing a user block. $this->serverError(_('Error removing the block.')); return; }