diff options
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 4a06c9258..c597137fe 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -63,8 +63,24 @@ class Notice extends Memcached_DataObject { $this->blowCaches(true); $this->blowFavesCache(true); - $this->blowInboxes(); - return parent::delete(); + $this->blowSubsCache(true); + + $this->query('BEGIN'); + $related = array('Reply', + 'Fave', + 'Notice_tag', + 'Group_inbox', + 'Queue_item'); + if (common_config('inboxes', 'enabled')) { + $related[] = 'Notice_inbox'; + } + foreach ($related as $cls) { + $inst = new $cls(); + $inst->notice_id = $this->id; + $inst->delete(); + } + $result = parent::delete(); + $this->query('COMMIT'); } function saveTags() @@ -568,22 +584,6 @@ class Notice extends Memcached_DataObject return; } - # Delete from inboxes if we're deleted. - - function blowInboxes() - { - - $enabled = common_config('inboxes', 'enabled'); - - if ($enabled === true || $enabled === 'transitional') { - $inbox = new Notice_inbox(); - $inbox->notice_id = $this->id; - $inbox->delete(); - } - - return; - } - function saveGroups() { $enabled = common_config('inboxes', 'enabled'); |