mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
parent
cf0110ab95
commit
9a4693136d
2 changed files with 5 additions and 1 deletions
|
@ -9,6 +9,7 @@ import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
|
|||
import org.asamk.signal.manager.api.PinLockedException;
|
||||
import org.asamk.signal.manager.config.ServiceConfig;
|
||||
import org.asamk.signal.manager.storage.SignalAccount;
|
||||
import org.asamk.signal.manager.util.KeyUtils;
|
||||
import org.asamk.signal.manager.util.NumberVerificationUtils;
|
||||
import org.signal.libsignal.protocol.InvalidKeyException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -99,6 +100,9 @@ public class AccountHelper {
|
|||
account.setNumber(number);
|
||||
account.setAci(aci);
|
||||
account.setPni(pni);
|
||||
if (account.isPrimaryDevice() && account.getPniIdentityKeyPair() == null && account.getPni() != null) {
|
||||
account.setPniIdentityKeyPair(KeyUtils.generateIdentityKeyPair());
|
||||
}
|
||||
account.getRecipientTrustedResolver().resolveSelfRecipientTrusted(account.getSelfRecipientAddress());
|
||||
// TODO check and update remote storage
|
||||
context.getUnidentifiedAccessHelper().rotateSenderCertificates();
|
||||
|
|
|
@ -402,7 +402,7 @@ public class SignalAccount implements Closeable {
|
|||
// Old config file, creating new profile key
|
||||
setProfileKey(KeyUtils.createProfileKey());
|
||||
}
|
||||
if (isPrimaryDevice() && getPniIdentityKeyPair() == null) {
|
||||
if (isPrimaryDevice() && getPniIdentityKeyPair() == null && getPni() != null) {
|
||||
setPniIdentityKeyPair(KeyUtils.generateIdentityKeyPair());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue