]> git.mxchange.org Git - friendica.git/commitdiff
remove event if attached item is deleted
authorFriendika <info@friendika.com>
Wed, 8 Jun 2011 07:47:00 +0000 (00:47 -0700)
committerFriendika <info@friendika.com>
Wed, 8 Jun 2011 07:47:00 +0000 (00:47 -0700)
mod/item.php

index 2c8cf256c6e12cc67fe86a66ff6a33426737b6e5..d7c15ff025bd4529f049441fae8d2af065e11998 100644 (file)
@@ -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']) {