X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/467a48bac508b56f84dce7ee0b81a22fd0d32161..53b84bad0280694a19e47d6f76620f8a140fdd15:/src/main/java/org/asamk/signal/commands/TrustCommand.java diff --git a/src/main/java/org/asamk/signal/commands/TrustCommand.java b/src/main/java/org/asamk/signal/commands/TrustCommand.java index 22dcc5d8..77fcc08a 100644 --- a/src/main/java/org/asamk/signal/commands/TrustCommand.java +++ b/src/main/java/org/asamk/signal/commands/TrustCommand.java @@ -24,7 +24,7 @@ public class TrustCommand implements JsonRpcLocalCommand { @Override public void attachToSubparser(final Subparser subparser) { subparser.help("Set the trust level of a given number."); - subparser.addArgument("number").help("Specify the phone number, for which to set the trust.").required(true); + subparser.addArgument("recipient").help("Specify the phone number, for which to set the trust.").required(true); var mutTrust = subparser.addMutuallyExclusiveGroup(); mutTrust.addArgument("-a", "--trust-all-known-keys") .help("Trust all known keys of this user, only use this for testing.") @@ -37,9 +37,9 @@ public class TrustCommand implements JsonRpcLocalCommand { public void handleCommand( final Namespace ns, final Manager m, final OutputWriter outputWriter ) throws CommandException { - var recipentString = ns.getString("number"); - var recipient = CommandUtil.getSingleRecipientIdentifier(recipentString, m.getUsername()); - if (ns.getBoolean("trust-all-known-keys")) { + var recipentString = ns.getString("recipient"); + var recipient = CommandUtil.getSingleRecipientIdentifier(recipentString, m.getSelfNumber()); + if (Boolean.TRUE.equals(ns.getBoolean("trust-all-known-keys"))) { boolean res = m.trustIdentityAllKeys(recipient); if (!res) { throw new UserErrorException("Failed to set the trust for this number, make sure the number is correct.");