if (dbm::is_result($r)) {
$found = true;
+ if ($r['blocked']) {
+ $r['id'] = -1;
+ }
$contact = $r;
$author["contact-id"] = $r["id"];
$author["author-link"] = $r["url"];
$r = dba::select('contact', array(), $condition, array('limit' => 1));
if (dbm::is_result($r)) {
+ if ($r['blocked']) {
+ $r['id'] = -1;
+ }
$contact = $r;
$author["contact-id"] = $r["id"];
$author["author-link"] = $r["url"];
$author["owner-avatar"] = $author["author-avatar"];
// Only update the contacts if it is an OStatus contact
- if ($r && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) {
+ if ($r && ($r['id'] > 0) && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) {
// Update contact data
$found = dba::exists('item', array('uid' => $importer["uid"], 'uri' => $item["uri"]));
if ($found) {
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists.", LOGGER_DEBUG);
+ } elseif ($item['contact-id'] < 0) {
+ logger("Item with uri ".$item["uri"]." is from a blocked contact.", LOGGER_DEBUG);
} else {
// We are having duplicated entries. Hopefully this solves it.
if (Lock::set('ostatus_process_item_store')) {