mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Fix registering
Only query prekeys count if registration is complete
This commit is contained in:
parent
edf5c9eb43
commit
9d18b01d85
1 changed files with 8 additions and 3 deletions
|
@ -41,6 +41,7 @@ import org.whispersystems.signalservice.api.crypto.SignalServiceCipher;
|
||||||
import org.whispersystems.signalservice.api.messages.*;
|
import org.whispersystems.signalservice.api.messages.*;
|
||||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||||
import org.whispersystems.signalservice.api.push.TrustStore;
|
import org.whispersystems.signalservice.api.push.TrustStore;
|
||||||
|
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
|
import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
|
||||||
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
import org.whispersystems.signalservice.api.util.InvalidNumberException;
|
||||||
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
|
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
|
||||||
|
@ -143,9 +144,13 @@ class Manager implements Signal {
|
||||||
groupStore = new JsonGroupStore();
|
groupStore = new JsonGroupStore();
|
||||||
}
|
}
|
||||||
accountManager = new SignalServiceAccountManager(URL, TRUST_STORE, username, password, USER_AGENT);
|
accountManager = new SignalServiceAccountManager(URL, TRUST_STORE, username, password, USER_AGENT);
|
||||||
if (accountManager.getPreKeysCount() < PREKEY_MINIMUM_COUNT) {
|
try {
|
||||||
refreshPreKeys();
|
if (registered && accountManager.getPreKeysCount() < PREKEY_MINIMUM_COUNT) {
|
||||||
save();
|
refreshPreKeys();
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
} catch (AuthorizationFailedException e) {
|
||||||
|
System.err.println("Authorization failed, was the number registered elsewhere?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue