mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Fix npr when upgrading old accounts
This commit is contained in:
parent
98a8c991e2
commit
795c5f6a04
1 changed files with 7 additions and 4 deletions
|
@ -396,9 +396,7 @@ public class SignalAccount implements Closeable {
|
|||
this.setStorageManifest(null);
|
||||
this.storageKey = null;
|
||||
trustSelfIdentity(ServiceIdType.ACI);
|
||||
if (getPniIdentityKeyPair() != null) {
|
||||
trustSelfIdentity(ServiceIdType.PNI);
|
||||
}
|
||||
trustSelfIdentity(ServiceIdType.PNI);
|
||||
}
|
||||
|
||||
private void migrateLegacyConfigs() {
|
||||
|
@ -1373,6 +1371,7 @@ public class SignalAccount implements Closeable {
|
|||
}
|
||||
|
||||
this.pni = updatedPni;
|
||||
trustSelfIdentity(ServiceIdType.PNI);
|
||||
save();
|
||||
}
|
||||
|
||||
|
@ -1676,7 +1675,11 @@ public class SignalAccount implements Closeable {
|
|||
private void trustSelfIdentity(ServiceIdType serviceIdType) {
|
||||
final var accountData = getAccountData(serviceIdType);
|
||||
final var serviceId = accountData.getServiceId();
|
||||
final var publicKey = accountData.getIdentityKeyPair().getPublicKey();
|
||||
final var identityKeyPair = accountData.getIdentityKeyPair();
|
||||
if (serviceId == null || identityKeyPair == null) {
|
||||
return;
|
||||
}
|
||||
final var publicKey = identityKeyPair.getPublicKey();
|
||||
getIdentityKeyStore().saveIdentity(serviceId, publicKey);
|
||||
getIdentityKeyStore().setIdentityTrustLevel(serviceId, publicKey, TrustLevel.TRUSTED_VERIFIED);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue