X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelay.php;h=11d1dbf8215a9871dbc4ffae535d8904a3f1ff94;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=f417b51924fa8330ce9c040641a16d869161529b;hpb=d666b6cb42a1b0d46e9fae914a803fbd5e10e2ab;p=friendica.git diff --git a/src/Console/Relay.php b/src/Console/Relay.php index f417b51924..11d1dbf821 100644 --- a/src/Console/Relay.php +++ b/src/Console/Relay.php @@ -1,6 +1,6 @@ dba = $dba; } - protected function doExecute() + protected function doExecute(): int { if ($this->getOption('v')) { $this->out('Executable: ' . $this->executable); @@ -90,13 +90,9 @@ HELP; } if ((count($this->args) == 1) && ($this->getArgument(0) == 'list')) { - $contacts = $this->dba->select('apcontact', ['url'], - ["`type` = ? AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", - 'Application', 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) { @@ -108,7 +104,7 @@ HELP; $actor = $this->getArgument(1); $apcontact = APContact::getByURL($actor); - if (empty($apcontact) || ($apcontact['type'] != 'Application')) { + if (empty($apcontact) || !in_array($apcontact['type'], ['Application', 'Service'])) { $this->out($actor . ' is no relay actor'); return 1; }