mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-03 22:24:23 +01:00
Return a Manager from ProvisioningManager and RegistrationManager when finished
This commit is contained in:
@@ -38,8 +38,9 @@ public class LinkCommand implements ProvisioningCommand {
|
||||
}
|
||||
try {
|
||||
writer.println("{}", m.getDeviceLinkUri());
|
||||
var username = m.finishDeviceLink(deviceName);
|
||||
writer.println("Associated with: {}", username);
|
||||
try (var manager = m.finishDeviceLink(deviceName)) {
|
||||
writer.println("Associated with: {}", manager.getUsername());
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
throw new UserErrorException("Link request timed out, please try again.");
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -28,7 +28,8 @@ public class VerifyCommand implements RegistrationCommand {
|
||||
var pin = ns.getString("pin");
|
||||
|
||||
try {
|
||||
m.verifyAccount(verificationCode, pin);
|
||||
final var manager = m.verifyAccount(verificationCode, pin);
|
||||
manager.close();
|
||||
} catch (LockedException e) {
|
||||
throw new UserErrorException(
|
||||
"Verification failed! This number is locked with a pin. Hours remaining until reset: "
|
||||
|
||||
Reference in New Issue
Block a user