Browse Source

Issue 5983: Central check for blocked and ignored contacts added

pull/7268/head
Michael 2 years ago
parent
commit
2482072457
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      src/Model/Item.php

+ 20
- 0
src/Model/Item.php View File

@ -1453,6 +1453,16 @@ class Item extends BaseObject
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;
}
if (!empty($uid) && ($item['parent-uri'] === $item['uri']) && Contact::isIgnoredByUser($item['author-link'], $uid)) {
Logger::notice('Author is ignored by user', ['author-link' => $item['author-link'], 'uid' => $uid, 'item-uri' => $item['uri']]);
return 0;
}
$default = ['url' => $item['owner-link'], 'name' => $item['owner-name'],
'photo' => $item['owner-avatar'], 'network' => $item['network']];
@ -1468,6 +1478,16 @@ class Item extends BaseObject
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 (!empty($uid) && ($item['parent-uri'] === $item['uri']) && Contact::isIgnoredByUser($item['owner-link'], $uid)) {
Logger::notice('Owner is ignored by user', ['owner-link' => $item['owner-link'], 'uid' => $uid, 'item-uri' => $item['uri']]);
return 0;
}
if ($item['network'] == Protocol::PHANTOM) {
$item['network'] = Protocol::DFRN;
Logger::notice('Missing network, setting to {network}.', [


Loading…
Cancel
Save