From 707af437e204ab6c1d2b972dcfad36889dbe9a57 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Thu, 20 Aug 2020 02:49:02 +0000
Subject: [PATCH] Fix sharing detection on reshares

---
 src/Model/Item.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Model/Item.php b/src/Model/Item.php
index 0050f93098..a77568c709 100644
--- a/src/Model/Item.php
+++ b/src/Model/Item.php
@@ -2026,13 +2026,13 @@ class Item
 			return;
 		}
 
-		if (Contact::getIdForURL($parent['author-link'], $item['uid'])) {
+		if (($author['contact-type'] != Contact::TYPE_COMMUNITY) && Contact::isSharing($parent['author-link'], $item['uid'])) {
 			logger::info('The parent author is a user contact: quit', ['author' => $parent['author-link'], 'uid' => $item['uid']]);
 			return;
 		}
 
 		$cid = Contact::getIdForURL($author['url'], $item['uid']);
-		if (empty($cid)) {
+		if (empty($cid) || !Contact::isSharing($cid, $item['uid'])) {
 			logger::info('The resharer is not a user contact: quit', ['resharer' => $author['url'], 'uid' => $item['uid']]);
 			return;
 		}
-- 
2.39.5