From 15dedf0ceb3ba48f4e4bd40931330bd3158adcff Mon Sep 17 00:00:00 2001 From: Marco Nassabain Date: Sun, 7 Feb 2021 20:55:49 +0100 Subject: =?UTF-8?q?=F0=9F=A9=B9=20Patch=20getNewestItemId:=20include=20sha?= =?UTF-8?q?red=20articles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- lib/Db/ItemMapper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Db') diff --git a/lib/Db/ItemMapper.php b/lib/Db/ItemMapper.php index bcf5aa1ec..7c3cb20b5 100644 --- a/lib/Db/ItemMapper.php +++ b/lib/Db/ItemMapper.php @@ -410,8 +410,10 @@ class ItemMapper extends NewsMapper 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'AND `feeds`.`user_id` = ?'; - $params = [$userId]; + 'AND ((`feeds`.`user_id` = ? ' . + 'AND `items`.`shared_by` = \'\') ' . + 'OR `items`.`shared_with` = ?)'; + $params = [$userId, $userId]; $result = $this->findOneQuery($sql, $params); -- cgit v1.2.3