mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
parent
4485188789
commit
c3e1d4fc75
3 changed files with 15 additions and 5 deletions
|
@ -16,15 +16,19 @@ public class RegisterCommand implements LocalCommand {
|
|||
subparser.addArgument("-v", "--voice")
|
||||
.help("The verification should be done over voice, not sms.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--captcha")
|
||||
.help("The captcha token, required if registration failed with a captcha required error.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int handleCommand(final Namespace ns, final Manager m) {
|
||||
try {
|
||||
m.register(ns.getBoolean("voice"));
|
||||
final boolean voiceVerification = ns.getBoolean("voice");
|
||||
final String captcha = ns.getString("captcha");
|
||||
m.register(voiceVerification, captcha);
|
||||
return 0;
|
||||
} catch (CaptchaRequiredException e) {
|
||||
System.err.println("Captcha required for verification (" + e.getMessage() + ")");
|
||||
System.err.println("Captcha invalid or required for verification (" + e.getMessage() + ")");
|
||||
return 1;
|
||||
} catch (IOException e) {
|
||||
System.err.println("Request verify error: " + e.getMessage());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue