From b402fddef9c1939aa501447bd6064449c4d41d3e Mon Sep 17 00:00:00 2001 From: Jimmy Huynh Date: Tue, 26 Jan 2021 18:14:05 +0100 Subject: (+) Adding sharing_user names to EVERY articles + pre-condition if sharedArticle: no title feed (e.g.: from wikiRSS...) Signed-off-by: Marco Nassabain --- lib/Db/Item.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Db') diff --git a/lib/Db/Item.php b/lib/Db/Item.php index 6b2b668b2..2a2629d3d 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -290,6 +290,11 @@ class Item extends Entity implements IAPI, \JsonSerializable return $this->starred; } + public function isShared(): bool + { + return $this->getSharedBy == '' && $this->getSharedWith == ''; + } + public function isUnread(): bool { return $this->unread; @@ -347,7 +352,10 @@ class Item extends Entity implements IAPI, \JsonSerializable 'rtl' => $this->getRtl(), 'intro' => $this->getIntro(), 'fingerprint' => $this->getFingerprint(), - 'categories' => $this->getCategories() + 'categories' => $this->getCategories(), + 'sharedBy' => $this->getSharedBy(), + 'sharedWith' => $this->getSharedWith(), + 'isShared' => $this->isShared() ]; } -- cgit v1.2.3