1
0
Fork 0

Delete attachments on item deletion

Delete video from videos page
This commit is contained in:
fabrixxm 2015-05-23 22:35:02 +02:00
commit 83697cf3e5
3 changed files with 101 additions and 14 deletions

View file

@ -4745,6 +4745,18 @@ function drop_item($id,$interactive = true) {
// ignore the result
}
// If item has attachments, drop them
foreach(explode(",",$item['attach']) as $attach){
preg_match("|attach/(\d+)|", $attach, $matches);
q("DELETE FROM `attach` WHERE `id` = %d AND `uid` = %d",
intval($matches[1]),
local_user()
);
// ignore the result
}
// clean up item_id and sign meta-data tables
/*
@ -4821,6 +4833,7 @@ function drop_item($id,$interactive = true) {
// Add a relayable_retraction signature for Diaspora.
store_diaspora_retract_sig($item, $a->user, $a->get_baseurl());
}
$drop_id = intval($item['id']);
// send the notification upstream/downstream as the case may be