]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/unblock.php
add events for unblocking a profile
[quix0rs-gnu-social.git] / actions / unblock.php
index c60458cd3ca810486714a1ea184e30d06cd51f45..0f63e1dae05802c4308f52e7f644d63fb81cbec1 100644 (file)
@@ -71,8 +71,17 @@ class UnblockAction extends ProfileFormAction
 
     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) {
             $this->serverError(_('Error removing the block.'));
             return;