-
- if ($this->user->hasBlocked($this->other)
- || $this->user->block($this->other)
- ) {
- $this->init_document($this->format);
- $this->show_profile($this->other, $this->format);
- $this->end_document($this->format);
+
+ 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);