mirror of
https://github.com/friendica/friendica
synced 2025-05-15 07:04:10 +02:00
Improve ignoring of messages
This commit is contained in:
parent
214838ea3b
commit
840f25cc5c
9 changed files with 121 additions and 21 deletions
|
@ -1333,6 +1333,19 @@ class Item
|
|||
$transmit = $notify || ($posted_item['visible'] && ($parent_origin || $posted_item['origin']));
|
||||
|
||||
if ($transmit) {
|
||||
if ($posted_item['uid'] && Contact\User::isBlocked($posted_item['author-id'], $posted_item['uid'])) {
|
||||
Logger::info('Message from blocked author will not be relayed', ['item' => $posted_item['id'], 'uri' => $posted_item['uri'], 'cid' => $posted_item['author-id']]);
|
||||
$transmit = false;
|
||||
}
|
||||
if ($transmit && $posted_item['uid'] && Contact\User::isBlocked($posted_item['owner-id'], $posted_item['uid'])) {
|
||||
Logger::info('Message from blocked owner will not be relayed', ['item' => $posted_item['id'], 'uri' => $posted_item['uri'], 'cid' => $posted_item['owner-id']]);
|
||||
$transmit = false;
|
||||
}
|
||||
if ($transmit && !empty($posted_item['causer-id']) && $posted_item['uid'] && Contact\User::isBlocked($posted_item['causer-id'], $posted_item['uid'])) {
|
||||
Logger::info('Message from blocked causer will not be relayed', ['item' => $posted_item['id'], 'uri' => $posted_item['uri'], 'cid' => $posted_item['causer-id']]);
|
||||
$transmit = false;
|
||||
}
|
||||
|
||||
// Don't relay participation messages
|
||||
if (($posted_item['verb'] == Activity::FOLLOW) &&
|
||||
(!$posted_item['origin'] || ($posted_item['author-id'] != Contact::getPublicIdByUserId($uid)))) {
|
||||
|
@ -3720,7 +3733,17 @@ class Item
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!empty($item['causer-id']) && ($item['gravity'] === self::GRAVITY_PARENT) && Contact\User::isIgnored($item['causer-id'], $user_id)) {
|
||||
if (!empty($item['author-id']) && Contact\User::isIgnored($item['author-id'], $user_id)) {
|
||||
Logger::notice('Author is ignored by user', ['author-link' => $item['author-link'], 'uid' => $user_id, 'item-uri' => $item['uri']]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($item['owner-id']) && Contact\User::isIgnored($item['owner-id'], $user_id)) {
|
||||
Logger::notice('Owner is ignored by user', ['owner-link' => $item['owner-link'], 'uid' => $user_id, 'item-uri' => $item['uri']]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($item['causer-id']) && Contact\User::isIgnored($item['causer-id'], $user_id)) {
|
||||
Logger::notice('Causer is ignored by user', ['causer-link' => $item['causer-link'] ?? $item['causer-id'], 'uid' => $user_id, 'item-uri' => $item['uri']]);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue