Merge pull request #7268 from annando/issue-5983

Issue 5983: Central check for blocked and ignored contacts added
This commit is contained in:
Hypolite Petovan 2019-06-15 16:53:41 -04:00 committed by GitHub
commit da114445c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1453,6 +1453,11 @@ class Item extends BaseObject
return 0; return 0;
} }
if (!empty($uid) && Contact::isBlockedByUser($item['author-link'], $uid)) {
Logger::notice('Author is blocked by user', ['author-link' => $item['author-link'], 'uid' => $uid, 'item-uri' => $item['uri']]);
return 0;
}
$default = ['url' => $item['owner-link'], 'name' => $item['owner-name'], $default = ['url' => $item['owner-link'], 'name' => $item['owner-name'],
'photo' => $item['owner-avatar'], 'network' => $item['network']]; 'photo' => $item['owner-avatar'], 'network' => $item['network']];
@ -1468,6 +1473,11 @@ class Item extends BaseObject
return 0; return 0;
} }
if (!empty($uid) && Contact::isBlockedByUser($item['owner-link'], $uid)) {
Logger::notice('Owner is blocked by user', ['owner-link' => $item['owner-link'], 'uid' => $uid, 'item-uri' => $item['uri']]);
return 0;
}
if ($item['network'] == Protocol::PHANTOM) { if ($item['network'] == Protocol::PHANTOM) {
$item['network'] = Protocol::DFRN; $item['network'] = Protocol::DFRN;
Logger::notice('Missing network, setting to {network}.', [ Logger::notice('Missing network, setting to {network}.', [