From ee3a4902def794911157843c61f27add58092dc1 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 4 Jul 2014 20:34:54 -0700 Subject: when deleting items, delete linked events and photos during stage1 --- include/items.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 7bb47a284..7f4dabaa7 100755 --- a/include/items.php +++ b/include/items.php @@ -3727,19 +3727,7 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) { intval($item['uid']) ); - - // network deletion request. Keep the message structure so that we can deliver delete notifications. - // Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2). - - if($stage == DROPITEM_PHASE1) - return true; - - $r = q("delete from term where otype = %d and oid = %d limit 1", - intval(TERM_OBJ_POST), - intval($item['id']) - ); - - // If item is a link to a photo resource, nuke all the associated photos + // If item is a link to a photo/event resource, nuke all the associated photos/events // This only applies to photos uploaded from the photos page. Photos inserted into a post do not // generate a resource_id and therefore aren't intimately linked to the item. @@ -3758,6 +3746,18 @@ function delete_item_lowlevel($item,$stage = DROPITEM_NORMAL) { } } + + // network deletion request. Keep the message structure so that we can deliver delete notifications. + // Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2). + + if($stage == DROPITEM_PHASE1) + return true; + + $r = q("delete from term where otype = %d and oid = %d limit 1", + intval(TERM_OBJ_POST), + intval($item['id']) + ); + q("delete from item_id where iid = %d and uid = %d limit 1", intval($item['id']), intval($item['uid']) -- cgit v1.2.3