add a hook for when someone deletes their own notice
This commit is contained in:
		@@ -1078,3 +1078,11 @@ StartShowPageTitle: when beginning to show the page title <h1>
 | 
			
		||||
 | 
			
		||||
EndShowPageTitle: when done showing the page title <h1>
 | 
			
		||||
- $action: action being shown
 | 
			
		||||
 | 
			
		||||
StartDeleteOwnNotice: when a user starts to delete their own notice
 | 
			
		||||
- $user: the user doing the delete
 | 
			
		||||
- $notice: the notice being deleted
 | 
			
		||||
 | 
			
		||||
EndDeleteOwnNotice: when a user has deleted their own notice
 | 
			
		||||
- $user: the user doing the delete
 | 
			
		||||
- $notice: the notice being deleted
 | 
			
		||||
 
 | 
			
		||||
@@ -125,10 +125,10 @@ class ApiStatusesDestroyAction extends ApiAuthAction
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($this->user->id == $this->notice->profile_id) {
 | 
			
		||||
            $replies = new Reply;
 | 
			
		||||
            $replies->get('notice_id', $this->notice_id);
 | 
			
		||||
            $replies->delete();
 | 
			
		||||
            $this->notice->delete();
 | 
			
		||||
            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(
 | 
			
		||||
 
 | 
			
		||||
@@ -172,7 +172,10 @@ class DeletenoticeAction extends Action
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($this->arg('yes')) {
 | 
			
		||||
            $this->notice->delete();
 | 
			
		||||
            if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
 | 
			
		||||
                $this->notice->delete();
 | 
			
		||||
                Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $url = common_get_returnto();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user