- $sql_post_table = "INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent` ";
- $visibility = sprintf("AND (`item`.`parent` = `item`.`id`) OR (`item`.`network` = '%s' AND `thread`.`network`='%s')",
- dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS));
+ $sql_post_table = "INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`
+ LEFT JOIN `item` AS `thritem` ON `thritem`.`uri`=`item`.`thr-parent` AND `thritem`.`uid`=`item`.`uid`";
+ $visibility = sprintf("AND (`item`.`parent` = `item`.`id`) OR (`item`.`network` = '%s' AND ((`thread`.`network`='%s') OR (`thritem`.`network` = '%s')))",
+ dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_OSTATUS));