From a074cccb0ed6019845645cfed52ff3170f48bb53 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 16 Jul 2009 00:52:23 -0400 Subject: [PATCH] save an archive of deleted notices --- classes/Notice.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index ebd5e1efd5..9578d87b2b 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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', -- 2.39.5