Merge pull request #4291 from annando/dont-delete
Don't delete - but only mark as deleted
This commit is contained in:
commit
3ac1992237
1 changed files with 15 additions and 19 deletions
|
@ -131,8 +131,6 @@ class Item
|
||||||
dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
|
dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When it is our item we don't delete it here, since we have to send delete messages
|
|
||||||
if ($item['origin'] || $parent['origin']) {
|
|
||||||
// Set the item to "deleted"
|
// Set the item to "deleted"
|
||||||
dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
|
dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
|
||||||
'edited' => datetime_convert(), 'changed' => datetime_convert()],
|
'edited' => datetime_convert(), 'changed' => datetime_convert()],
|
||||||
|
@ -151,10 +149,8 @@ class Item
|
||||||
}
|
}
|
||||||
|
|
||||||
// send the notification upstream/downstream
|
// send the notification upstream/downstream
|
||||||
|
if ($item['origin'] || $parent['origin']) {
|
||||||
Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", intval($item['id']));
|
Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", intval($item['id']));
|
||||||
} else {
|
|
||||||
// delete it immediately. All related children will be deleted as well.
|
|
||||||
dba::delete('item', ['id' => $item['id']]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue