X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=aa3800cbe175c55c5897969a36f9bf9d97f32926;hb=a785d8c2f9a95b933c8a81566331874e47926dd5;hp=8125c4ac7126b341717ccd7b9f6a1b58b4397a50;hpb=801a13aa102f75c76e6d5b83db98bc96348ccd11;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index 8125c4ac71..aa3800cbe1 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -862,12 +862,33 @@ class Item extends BaseObject } unset($item['id']); - - $condition = ["`nurl` IN (SELECT `nurl` FROM `contact` WHERE `id` = ?) AND `uid` != 0 AND NOT `blocked` AND `rel` IN (?, ?)", + 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); } }