summaryrefslogtreecommitdiffstats
path: root/lib/Db
diff options
context:
space:
mode:
authorMarco Nassabain <marco.nassabain@hotmail.com>2021-02-07 20:55:49 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit15dedf0ceb3ba48f4e4bd40931330bd3158adcff (patch)
tree3fb386ca19b64e6b07b9c7e731c01f6fe56e1808 /lib/Db
parent11bd056bdf1646fc670dba4b9611f8e0c3eaff97 (diff)
🩹 Patch getNewestItemId: include shared articles
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Db')
-rw-r--r--lib/Db/ItemMapper.php6
1 files changed, 4 insertions, 2 deletions
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);