From: Friendika Date: Wed, 8 Jun 2011 07:47:00 +0000 (-0700) Subject: remove event if attached item is deleted X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a10abd4860ee2e34b197fd7c1bba295cd35c1a9b;p=friendica.git remove event if attached item is deleted --- diff --git a/mod/item.php b/mod/item.php index 2c8cf256c6..d7c15ff025 100644 --- a/mod/item.php +++ b/mod/item.php @@ -772,6 +772,17 @@ function item_content(&$a) { // ignore the result } + // If item is a link to an event, nuke the event record. + + if(intval($item['event-id'])) { + q("DELETE FROM `event` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($item['event-id']), + intval($item['uid']) + ); + // ignore the result + } + + // If it's the parent of a comment thread, kill all the kids if($item['uri'] == $item['parent-uri']) {