X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelay.php;h=4f6bbc6b6b7c54ca1301ccb107beea18d936798f;hb=49c47008d189617ec989b04c8ec42b3c1484e87f;hp=ab994dc62c1af0e2b030e8279c7fd6152ea2731f;hpb=b8f3c4b065264b595613d8690d698176f78f30bb;p=friendica.git diff --git a/src/Console/Relay.php b/src/Console/Relay.php index ab994dc62c..4f6bbc6b6b 100644 --- a/src/Console/Relay.php +++ b/src/Console/Relay.php @@ -1,6 +1,6 @@ [-h|--help|-?] [-v] - bin/console relay remove [-h|--help|-?] [-v] + bin/console relay remove [-f|--force] [-h|--help|-?] [-v] Description bin/console relay list @@ -62,6 +62,7 @@ Description Remove a relay actor in the format https://relayserver.tld/actor Options + -f|--force Change the relay status in the system even if the unsubscribe message failed -h|--help|-? Show help information -v Show more debug information. HELP; @@ -90,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` = ? AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", + 'Application', 0, Contact::FRIEND]); while ($contact = $this->dba->fetch($contacts)) { $this->out($contact['url']); } @@ -119,10 +120,14 @@ HELP; $this->out($actor . " couldn't be added"); } } elseif ($mode == 'remove') { - if (Transmitter::sendRelayUndoFollow($actor)) { + $force = $this->getOption(['f', 'force'], false); + + if (Transmitter::sendRelayUndoFollow($actor, $force)) { $this->out('Successfully removed ' . $actor); - } else { + } elseif (!$force) { $this->out($actor . " couldn't be removed"); + } else { + $this->out($actor . " is forcefully removed"); } } else { throw new CommandArgsException($mode . ' is no valid command');