- // If the page user is the owner of the page we should query for unseen
- // items. Otherwise use a timestamp of the last succesful update request.
- if ($is_owner || !$last_updated) {
- $sql_extra4 = " AND `unseen`";
+ $condition = ["`uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending`
+ AND `visible` AND (NOT `deleted` OR `gravity` = ?)
+ AND `wall` " . $sql_extra, $a->getProfileOwner(), Item::GRAVITY_ACTIVITY];
+
+ if ($_GET['force'] && !empty($_GET['item'])) {
+ // When the parent is provided, we only fetch this
+ $condition = DBA::mergeConditions($condition, ['parent' => $_GET['item']]);
+ } elseif ($is_owner || !$last_updated) {
+ // If the page user is the owner of the page we should query for unseen
+ // items. Otherwise use a timestamp of the last succesful update request.
+ $condition = DBA::mergeConditions($condition, ['unseen' => true]);