mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Check if account is already registered before attempting verification
This commit is contained in:
parent
895740755d
commit
b41ebfe6b8
1 changed files with 4 additions and 0 deletions
|
@ -129,6 +129,10 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
||||||
public void verifyAccount(
|
public void verifyAccount(
|
||||||
String verificationCode, String pin
|
String verificationCode, String pin
|
||||||
) throws IOException, PinLockedException, IncorrectPinException {
|
) throws IOException, PinLockedException, IncorrectPinException {
|
||||||
|
if (account.isRegistered()) {
|
||||||
|
throw new IOException("Account is already registered");
|
||||||
|
}
|
||||||
|
|
||||||
if (account.getPniIdentityKeyPair() == null) {
|
if (account.getPniIdentityKeyPair() == null) {
|
||||||
account.setPniIdentityKeyPair(KeyUtils.generateIdentityKeyPair());
|
account.setPniIdentityKeyPair(KeyUtils.generateIdentityKeyPair());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue