]> 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>
Tue, 4 Aug 2009 10:05:04 +0000 (06:05 -0400)
classes/Notice.php

index ebd5e1efd5c9c1b00b7641ec43b3e59822ce6617..9578d87b2b149925e8fefffc17c43abd3b3c75b3 100644 (file)
@@ -75,7 +75,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',