mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 19:10:38 +00:00
Refactor register and verify
This commit is contained in:
parent
6c8a1ff3d3
commit
e74be0c345
33 changed files with 405 additions and 362 deletions
|
@ -3,14 +3,14 @@ package org.asamk.signal.commands;
|
|||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
import net.sourceforge.argparse4j.inf.Subparser;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.RegistrationManager;
|
||||
import org.whispersystems.signalservice.api.KeyBackupServicePinException;
|
||||
import org.whispersystems.signalservice.api.KeyBackupSystemNoDataException;
|
||||
import org.whispersystems.signalservice.internal.push.LockedException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class VerifyCommand implements LocalCommand {
|
||||
public class VerifyCommand implements RegistrationCommand {
|
||||
|
||||
@Override
|
||||
public void attachToSubparser(final Subparser subparser) {
|
||||
|
@ -19,11 +19,7 @@ public class VerifyCommand implements LocalCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int handleCommand(final Namespace ns, final Manager m) {
|
||||
if (m.isRegistered()) {
|
||||
System.err.println("User registration is already verified");
|
||||
return 1;
|
||||
}
|
||||
public int handleCommand(final Namespace ns, final RegistrationManager m) {
|
||||
try {
|
||||
String verificationCode = ns.getString("verificationCode");
|
||||
String pin = ns.getString("pin");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue