- if ($this->user->id == $this->notice->profile_id) {
- $replies = new Reply;
- $replies->get('notice_id', $this->notice_id);
- $replies->delete();
- $this->notice->delete();
- $this->showNotice();
- } else {
- $this->clientError(_('You may not delete another user\'s status.'),
- 403, $this->format);
- }
+ if ($this->user->id == $this->notice->profile_id) {
+ if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
+ $this->notice->delete();
+ Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
+ }
+ $this->showNotice();
+ } else {
+ $this->clientError(
+ // TRANS: Client error displayed trying to delete a status of another user.
+ _('You may not delete another user\'s status.'),
+ 403,
+ $this->format
+ );
+ }