]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
save an archive of deleted notices
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 16 Jul 2009 04:52:23 +0000 (00:52 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 16 Jul 2009 04:52:23 +0000 (00:52 -0400)
classes/Notice.php

index 0359c310d4b82237e2d43d7dfe648e01af4aa39b..c6ad7d6c4568e912e314da8b4bfd9839d9aa579b 100644 (file)
@@ -74,7 +74,21 @@ class Notice extends Memcached_DataObject
         $this->blowFavesCache(true);
         $this->blowSubsCache(true);
 
+        // For auditing purposes, save a record that the notice
+        // was deleted.
+
+        $deleted = new Deleted_notice();
+
+        $deleted->id         = $this->id;
+        $deleted->profile_id = $this->profile_id;
+        $deleted->uri        = $this->uri;
+        $deleted->created    = $this->created;
+        $deleted->deleted    = common_sql_now();
+
         $this->query('BEGIN');
+
+        $deleted->insert();
+
         //Null any notices that are replies to this notice
         $this->query(sprintf("UPDATE notice set reply_to = null WHERE reply_to = %d", $this->id));
         $related = array('Reply',