mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Initialize pre key offsets when creating new account
This commit is contained in:
parent
cdef9c435c
commit
f1ccfc0361
1 changed files with 8 additions and 0 deletions
|
@ -228,6 +228,7 @@ public class SignalAccount implements Closeable {
|
||||||
signalAccount.pniAccountData.setIdentityKeyPair(pniIdentityKey);
|
signalAccount.pniAccountData.setIdentityKeyPair(pniIdentityKey);
|
||||||
signalAccount.aciAccountData.setLocalRegistrationId(KeyHelper.generateRegistrationId(false));
|
signalAccount.aciAccountData.setLocalRegistrationId(KeyHelper.generateRegistrationId(false));
|
||||||
signalAccount.pniAccountData.setLocalRegistrationId(KeyHelper.generateRegistrationId(false));
|
signalAccount.pniAccountData.setLocalRegistrationId(KeyHelper.generateRegistrationId(false));
|
||||||
|
signalAccount.initAllPreKeyIds();
|
||||||
signalAccount.settings = settings;
|
signalAccount.settings = settings;
|
||||||
|
|
||||||
signalAccount.registered = false;
|
signalAccount.registered = false;
|
||||||
|
@ -974,6 +975,13 @@ public class SignalAccount implements Closeable {
|
||||||
clearAllPreKeys(ServiceIdType.PNI);
|
clearAllPreKeys(ServiceIdType.PNI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initAllPreKeyIds() {
|
||||||
|
resetPreKeyOffsets(ServiceIdType.ACI);
|
||||||
|
resetPreKeyOffsets(ServiceIdType.PNI);
|
||||||
|
resetKyberPreKeyOffsets(ServiceIdType.ACI);
|
||||||
|
resetKyberPreKeyOffsets(ServiceIdType.PNI);
|
||||||
|
}
|
||||||
|
|
||||||
private void clearAllPreKeys(ServiceIdType serviceIdType) {
|
private void clearAllPreKeys(ServiceIdType serviceIdType) {
|
||||||
final var accountData = getAccountData(serviceIdType);
|
final var accountData = getAccountData(serviceIdType);
|
||||||
resetPreKeyOffsets(serviceIdType);
|
resetPreKeyOffsets(serviceIdType);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue