]> git.mxchange.org Git - friendica.git/commitdiff
Additional check if the duplicated entry isn't from a hidden or blocked contact.
authorMichael Vogel <icarus@dabo.de>
Sun, 21 Dec 2014 22:47:19 +0000 (23:47 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 21 Dec 2014 22:47:19 +0000 (23:47 +0100)
include/threads.php

index 0db8586354db6a5d0dd6630f9a8b174984c1f3b4..f80212fad49d972ffce710cfc76ac40d7dfca920 100644 (file)
@@ -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