From: Michael Date: Sun, 29 Apr 2018 16:32:46 +0000 (+0000) Subject: Fix PR 4942: Fixed item query X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=78f563407ae7673e10aa4c3321da20f16dff1dd2;p=friendica.git Fix PR 4942: Fixed item query --- diff --git a/include/conversation.php b/include/conversation.php index 85f6547340..0d6f852c83 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -471,8 +471,9 @@ These Fields are not added below (yet). They are here to for bug search. */ function item_joins() { return sprintf("STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND (`contact`.`rel` IN (%s, %s) OR `contact`.`self`) - AND NOT (`contact`.`blocked` OR `contact`.`readonly` OR `contact`.`pending`) + AND NOT `contact`.`blocked` + AND ((NOT `contact`.`readonly` AND NOT `contact`.`pending` AND (`contact`.`rel` IN (%s, %s))) + OR `contact`.`self` OR (`item`.`id` != `item`.`parent`)) LEFT JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` LEFT JOIN `contact` AS `owner` ON `owner`.`id`=`item`.`owner-id` LEFT JOIN `event` ON `event-id` = `event`.`id`",