Performance improvements when storing items (via API)

This commit is contained in:
Michael 2016-11-12 13:17:28 +00:00
parent 8f6e9fa65e
commit e6148f4c1c
6 changed files with 102 additions and 49 deletions

View file

@ -123,8 +123,19 @@ function add_shadow_thread($itemid) {
function add_shadow_entry($itemid) {
$items = q("SELECT * FROM `item` WHERE `id` = %d", intval($itemid));
if (!dbm::is_result($items)) {
return;
}
$item = $items[0];
// Is it a toplevel post?
if ($item['id'] == $item['parent']) {
add_shadow_thread($itemid);
return;
}
// Is this a shadow entry?
if ($item['uid'] == 0)
return;