remove event if attached item is deleted

This commit is contained in:
Friendika 2011-06-08 00:47:00 -07:00
parent 0bfb6314df
commit a10abd4860
1 changed files with 11 additions and 0 deletions

View 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']) {