mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:10:24 +00:00
News "blocked" field on the gserver table
This commit is contained in:
parent
d63aca97b8
commit
356a2a9a5a
14 changed files with 140 additions and 15 deletions
|
@ -42,7 +42,7 @@ class Peers extends BaseApi
|
|||
$return = [];
|
||||
|
||||
// We only select for Friendica and ActivityPub servers, since it is expected to only deliver AP compatible systems here.
|
||||
$instances = DBA::select('gserver', ['url'], ["`network` in (?, ?) AND NOT `failed` AND NOT `detection-method` IN (?, ?, ?, ?)",
|
||||
$instances = DBA::select('gserver', ['url'], ["`network` in (?, ?) AND NOT `blocked` AND NOT `failed` AND NOT `detection-method` IN (?, ?, ?, ?)",
|
||||
Protocol::DFRN, Protocol::ACTIVITYPUB,
|
||||
GServer::DETECT_MANUAL, GServer::DETECT_HEADER, GServer::DETECT_BODY, GServer::DETECT_HOST_META]);
|
||||
while ($instance = DBA::fetch($instances)) {
|
||||
|
|
|
@ -75,6 +75,8 @@ class Add extends BaseModeration
|
|||
// Add new item to blocklist
|
||||
$this->blocklist->addPattern($pattern, trim($request['reason']));
|
||||
|
||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
|
||||
|
||||
$this->systemMessages->addInfo($this->t('Server domain pattern added to the blocklist.'));
|
||||
|
||||
if (!empty($request['purge'])) {
|
||||
|
|
|
@ -25,6 +25,7 @@ use Friendica\App;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Moderation\DomainPatternBlocklist;
|
||||
use Friendica\Module\Response;
|
||||
use Friendica\Navigation\SystemMessages;
|
||||
|
@ -95,6 +96,8 @@ class Import extends \Friendica\Module\BaseModeration
|
|||
}
|
||||
}
|
||||
|
||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
|
||||
|
||||
$this->baseUrl->redirect('/moderation/blocklist/server');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ use Friendica\App;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Moderation\DomainPatternBlocklist;
|
||||
use Friendica\Module\BaseModeration;
|
||||
use Friendica\Module\Response;
|
||||
|
@ -70,6 +71,8 @@ class Index extends BaseModeration
|
|||
|
||||
$this->blocklist->set($blocklist);
|
||||
|
||||
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
|
||||
|
||||
$this->baseUrl->redirect('moderation/blocklist/server');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue