mirror of
https://github.com/friendica/friendica
synced 2024-11-19 09:43:45 +00:00
Merge pull request #6185 from annando/blocked
Checking for blocked user does now check for blocked domain as well
This commit is contained in:
commit
2b7f57453b
3 changed files with 20 additions and 1 deletions
|
@ -1285,10 +1285,15 @@ class Contact extends BaseObject
|
|||
return false;
|
||||
}
|
||||
|
||||
$blocked = DBA::selectFirst('contact', ['blocked'], ['id' => $cid]);
|
||||
$blocked = DBA::selectFirst('contact', ['blocked', 'url'], ['id' => $cid]);
|
||||
if (!DBA::isResult($blocked)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Network::isUrlBlocked($blocked['url'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (bool) $blocked['blocked'];
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ use Friendica\Protocol\ActivityPub;
|
|||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Util\Map;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
require_once 'include/api.php';
|
||||
|
||||
|
@ -446,6 +447,10 @@ class Transmitter
|
|||
|
||||
$contacts = DBA::select('contact', ['url'], $condition);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
if (Network::isUrlBlocked($contact['url'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$profile = APContact::getByURL($contact['url'], false);
|
||||
if (!empty($profile)) {
|
||||
if (empty($profile['sharedinbox']) || $personal) {
|
||||
|
@ -493,6 +498,10 @@ class Transmitter
|
|||
$blindcopy = in_array($element, ['bto', 'bcc']);
|
||||
|
||||
foreach ($permissions[$element] as $receiver) {
|
||||
if (Network::isUrlBlocked($receiver)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($receiver == $item_profile['followers']) {
|
||||
$inboxes = array_merge($inboxes, self::fetchTargetInboxesforUser($uid, $personal));
|
||||
} else {
|
||||
|
|
|
@ -19,6 +19,7 @@ use Friendica\Protocol\DFRN;
|
|||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Protocol\Email;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
require_once 'include/items.php';
|
||||
|
||||
|
@ -158,6 +159,10 @@ class Delivery extends BaseObject
|
|||
return;
|
||||
}
|
||||
|
||||
if (Network::isUrlBlocked($contact['url'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transmit via Diaspora if the thread had started as Diaspora post
|
||||
// This is done since the uri wouldn't match (Diaspora doesn't transmit it)
|
||||
if (isset($parent) && ($parent['network'] == Protocol::DIASPORA) && ($contact['network'] == Protocol::DFRN)) {
|
||||
|
|
Loading…
Reference in a new issue