- "SELECT DISTINCT(`parent-uri`) AS `uri`, `item`.`created`
- FROM `item`
- INNER JOIN `contact`
- ON `contact`.`id` = `item`.`contact-id`
- AND NOT `contact`.`blocked`
- AND NOT `contact`.`pending`
- WHERE `item`.`uid` = ?
- AND `item`.`visible`
- AND (NOT `item`.`deleted` OR `item`.`gravity` = ?)
- AND NOT `item`.`moderated`
- AND `item`.`wall`
- $sql_extra4
- $sql_extra
- ORDER BY `item`.`received` DESC",
+ "SELECT DISTINCT(`parent-uri`) AS `uri`, `created` FROM `post-view`
+ WHERE `uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending`
+ AND `visible` AND (NOT `deleted` OR `gravity` = ?)
+ AND NOT `moderated` AND `wall` $sql_extra4 $sql_extra
+ ORDER BY `received` DESC",