Preparation for the possibility to globally block contacts

This commit is contained in:
Michael 2017-10-07 09:52:43 +00:00
parent cc9074bed5
commit c6dbbe21b4
3 changed files with 54 additions and 1 deletions

View file

@ -32,7 +32,7 @@ function add_thread($itemid, $onlyshadow = false) {
* @param integer $itemid Item ID that should be added
*/
function add_shadow_thread($itemid) {
$items = q("SELECT `uid`, `wall`, `private`, `moderated`, `visible`, `contact-id`, `deleted`, `network`
$items = q("SELECT `uid`, `wall`, `private`, `moderated`, `visible`, `contact-id`, `deleted`, `network`, `author-id`, `owner-id`
FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid));
if (!dbm::is_result($items)) {
@ -56,6 +56,11 @@ function add_shadow_thread($itemid) {
return;
}
// Is the public contact configured as hidden?
if (hiddenContact($item["owner-id"]) || hiddenContact($item["author-id"])) {
return;
}
// 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