]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apiblockcreate.php
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / actions / apiblockcreate.php
index e79dec32d0521ced06d3da89c6a4226ac05e89d0..c26485f591b23196917eb07f3fcc8b65e6ab72d3 100644 (file)
@@ -109,9 +109,16 @@ class ApiBlockCreateAction extends ApiAuthAction
             return;
         }
 
-        if ($this->user->hasBlocked($this->other)
-            || $this->user->block($this->other)
-        ) {
+        if (!$this->user->hasBlocked($this->other)) {
+            if (Event::handle('StartBlockProfile', array($this->user, $this->other))) {
+                $result = $this->user->block($this->other);
+                if ($result) {
+                    Event::handle('EndBlockProfile', 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);