From 2ab38de59c15d949b27563a261ac858d7ac4266e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 21 Dec 2014 23:47:19 +0100 Subject: [PATCH] Additional check if the duplicated entry isn't from a hidden or blocked contact. --- include/threads.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/threads.php b/include/threads.php index 0db8586354..f80212fad4 100644 --- a/include/threads.php +++ b/include/threads.php @@ -35,13 +35,18 @@ function add_thread($itemid, $onlyshadow = false) { if (!in_array($item["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED, ""))) return; - // Check, if hide-friends is activated - then don't do a shadow entry - // Only do this check if the post isn't a wall post + // Only do these checks if the post isn't a wall post if (!$item["wall"]) { + // Check, if hide-friends is activated - then don't do a shadow entry $r = q("SELECT `hide-friends` FROM `profile` WHERE `is-default` AND `uid` = %d AND NOT `hide-friends`", $item['uid']); if (!count($r)) return; + // Check if the contact is hidden or blocked + $r = q("SELECT `id` FROM `contact` WHERE NOT `hidden` AND NOT `blocked` AND `id` = %d", + $item['contact-id']); + if (!count($r)) + return; } // Only add a shadow, if the profile isn't hidden