mirror of
https://github.com/friendica/friendica
synced 2025-04-24 09:50:11 +00:00
Performance improvements when storing items (via API)
This commit is contained in:
parent
8f6e9fa65e
commit
e6148f4c1c
6 changed files with 102 additions and 49 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue