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

@ -761,10 +761,20 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$arr["author-id"] = get_contact($arr["author-link"], 0);
}
if (blockedContact($arr["author-id"])) {
logger('Contact '.$arr["author-id"].' is blocked, item '.$arr["uri"].' will not be stored');
return 0;
}
if ($arr["owner-id"] == 0) {
$arr["owner-id"] = get_contact($arr["owner-link"], 0);
}
if (blockedContact($arr["owner-id"])) {
logger('Contact '.$arr["owner-id"].' is blocked, item '.$arr["uri"].' will not be stored');
return 0;
}
if ($arr['guid'] != "") {
// Checking if there is already an item with the same guid
logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG);