Check if the author should be ignored when fetching missing posts
This commit is contained in:
parent
7dbd8ed473
commit
4b858650ce
1 changed files with 13 additions and 1 deletions
|
@ -975,9 +975,21 @@ function diaspora_store_by_guid($guid, $server, $uid = 0) {
|
||||||
|
|
||||||
$person = find_diaspora_person_by_handle($author);
|
$person = find_diaspora_person_by_handle($author);
|
||||||
|
|
||||||
|
$contact_id = get_contact($person['url'], $uid);
|
||||||
|
|
||||||
|
$contacts = q("SELECT * FROM `contact` WHERE `id` = %d", intval($contact_id));
|
||||||
|
$importers = q("SELECT * FROM `user` WHERE `uid` = %d", intval($uid));
|
||||||
|
|
||||||
|
if ($contacts AND $importers)
|
||||||
|
if(!diaspora_post_allow($importers[0],$contacts[0], false)) {
|
||||||
|
logger('Ignoring author '.$person['url'].' for uid '.$uid);
|
||||||
|
return false;
|
||||||
|
} else
|
||||||
|
logger('Author '.$person['url'].' is allowed for uid '.$uid);
|
||||||
|
|
||||||
$datarray = array();
|
$datarray = array();
|
||||||
$datarray['uid'] = $uid;
|
$datarray['uid'] = $uid;
|
||||||
$datarray['contact-id'] = get_contact($person['url'], $uid);
|
$datarray['contact-id'] = $contact_id;
|
||||||
$datarray['wall'] = 0;
|
$datarray['wall'] = 0;
|
||||||
$datarray['network'] = NETWORK_DIASPORA;
|
$datarray['network'] = NETWORK_DIASPORA;
|
||||||
$datarray['guid'] = $guid;
|
$datarray['guid'] = $guid;
|
||||||
|
|
Loading…
Reference in a new issue