X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelay.php;h=11d1dbf8215a9871dbc4ffae535d8904a3f1ff94;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=52682241e69c63941ec84610a70445fad4287b7b;hpb=4faf08c0643d3e6bbe2a0a77be2ff8c1dbea4d5c;p=friendica.git diff --git a/src/Console/Relay.php b/src/Console/Relay.php index 52682241e6..11d1dbf821 100644 --- a/src/Console/Relay.php +++ b/src/Console/Relay.php @@ -23,8 +23,8 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; use Friendica\Model\APContact; -use Friendica\Model\Contact; use Friendica\Protocol\ActivityPub\Transmitter; +use Friendica\Protocol\Relay as ProtocolRelay; /** * tool to control the list of ActivityPub relay servers from the CLI @@ -90,13 +90,9 @@ HELP; } if ((count($this->args) == 1) && ($this->getArgument(0) == 'list')) { - $contacts = $this->dba->select('apcontact', ['url'], - ["`type` IN (?, ?) AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", - 'Application', 'Service', 0, Contact::FRIEND]); - while ($contact = $this->dba->fetch($contacts)) { + foreach (ProtocolRelay::getList(['url']) as $contact) { $this->out($contact['url']); } - $this->dba->close($contacts); } elseif (count($this->args) == 0) { throw new CommandArgsException('too few arguments'); } elseif (count($this->args) == 1) {