]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apistatusesdestroy.php
Pretty it up a bit more
[quix0rs-gnu-social.git] / actions / apistatusesdestroy.php
index 749f72e68d2d9b43b59f774d6c102ff56fd073d9..485eae66eab0c304c0816f828159bc137b029917 100644 (file)
@@ -29,6 +29,7 @@
  * @author    Robin Millette <robin@millette.info>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -124,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(