X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelay.php;h=f06c3a7d5c01c35a4e0a3c32654c6353366f15af;hb=9fbdcb5459e4acb158961427837612999253e046;hp=206726f6bca6862dd261fc8a8b843d5faf778b68;hpb=eff4d1820939d6338ceaa128d05fa8dba93257e2;p=friendica.git diff --git a/src/Console/Relay.php b/src/Console/Relay.php index 206726f6bc..f06c3a7d5c 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); @@ -91,8 +91,8 @@ 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` IN (?, ?))", - 'Application', 0, Contact::FOLLOWER, Contact::FRIEND]); + ["`type` IN (?, ?) AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", + 'Application', 'Service', 0, Contact::FRIEND]); while ($contact = $this->dba->fetch($contacts)) { $this->out($contact['url']); } @@ -108,7 +108,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; }