From c417f779c4660bdc47a124ed2343e2502fbcc02d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 28 Apr 2018 07:47:02 -0400 Subject: [PATCH] Add missing readonly check for displaying items in item_joins --- include/conversation.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 41f10959b2..bd3481670e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -470,11 +470,14 @@ These Fields are not added below (yet). They are here to for bug search. * @brief SQL join for contacts that are needed for displaying items */ function item_joins() { - return "STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND - (NOT `contact`.`blocked` OR `contact`.`pending`) + return sprintf("STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` + AND `contact`.`rel` IN (%s, %s) + AND NOT (`contact`.`blocked` OR `contact`.`readonly` OR `contact`.`pending`) 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`"; + LEFT JOIN `event` ON `event-id` = `event`.`id`", + CONTACT_IS_SHARING, CONTACT_IS_FRIEND + ); } /**