mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50: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.setStorageManifest(null);
|
||||||
this.storageKey = null;
|
this.storageKey = null;
|
||||||
trustSelfIdentity(ServiceIdType.ACI);
|
trustSelfIdentity(ServiceIdType.ACI);
|
||||||
if (getPniIdentityKeyPair() != null) {
|
trustSelfIdentity(ServiceIdType.PNI);
|
||||||
trustSelfIdentity(ServiceIdType.PNI);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void migrateLegacyConfigs() {
|
private void migrateLegacyConfigs() {
|
||||||
|
@ -1373,6 +1371,7 @@ public class SignalAccount implements Closeable {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pni = updatedPni;
|
this.pni = updatedPni;
|
||||||
|
trustSelfIdentity(ServiceIdType.PNI);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1676,7 +1675,11 @@ public class SignalAccount implements Closeable {
|
||||||
private void trustSelfIdentity(ServiceIdType serviceIdType) {
|
private void trustSelfIdentity(ServiceIdType serviceIdType) {
|
||||||
final var accountData = getAccountData(serviceIdType);
|
final var accountData = getAccountData(serviceIdType);
|
||||||
final var serviceId = accountData.getServiceId();
|
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().saveIdentity(serviceId, publicKey);
|
||||||
getIdentityKeyStore().setIdentityTrustLevel(serviceId, publicKey, TrustLevel.TRUSTED_VERIFIED);
|
getIdentityKeyStore().setIdentityTrustLevel(serviceId, publicKey, TrustLevel.TRUSTED_VERIFIED);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue