X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=aa3800cbe175c55c5897969a36f9bf9d97f32926;hb=a785d8c2f9a95b933c8a81566331874e47926dd5;hp=c16281ae3ea204c5a875e5926936d64e5b9ca55f;hpb=a9f1f47be2d9f2bf97cc4cbe46789679bf5a42dd;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index c16281ae3e..aa3800cbe1 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -862,12 +862,33 @@ class Item extends BaseObject } unset($item['id']); + unset($item['parent']); + unset($item['mention']); + unset($item['wall']); + unset($item['origin']); + unset($item['global']); + unset($item['starred']); + unset($item['rendered-hash']); + unset($item['rendered-html']); + + $users = []; $condition = ["`nurl` IN (SELECT `nurl` FROM `contact` WHERE `id` = ?) AND `uid` != 0 AND NOT `blocked` AND NOT `readonly` AND `rel` IN (?, ?)", $parent['owner-id'], CONTACT_IS_SHARING, CONTACT_IS_FRIEND]; $contacts = dba::select('contact', ['uid'], $condition); while ($contact = dba::fetch($contacts)) { - self::storeForUser($itemid, $item, $contact['uid']); + $users[$contact['uid']] = $contact['uid']; + } + + if ($item['uri'] != $item['parent-uri']) { + $parents = dba::select('item', ['uid'], ["`uri` = ? AND `uid` != 0", $item['parent-uri']]); + while ($parent = dba::fetch($parents)) { + $users[$parent['uid']] = $parent['uid']; + } + } + + foreach ($users as $uid) { + self::storeForUser($itemid, $item, $uid); } }