mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Remove previous prekeys when importing legacy prekeys
This commit is contained in:
parent
b92cbc6a7c
commit
7aede7c17f
1 changed files with 2 additions and 0 deletions
|
@ -829,6 +829,7 @@ public class SignalAccount implements Closeable {
|
||||||
logger.debug("Migrating legacy pre key store.");
|
logger.debug("Migrating legacy pre key store.");
|
||||||
for (var entry : legacySignalProtocolStore.getLegacyPreKeyStore().getPreKeys().entrySet()) {
|
for (var entry : legacySignalProtocolStore.getLegacyPreKeyStore().getPreKeys().entrySet()) {
|
||||||
try {
|
try {
|
||||||
|
aciAccountData.getPreKeyStore().removeAllPreKeys();
|
||||||
aciAccountData.getPreKeyStore().storePreKey(entry.getKey(), new PreKeyRecord(entry.getValue()));
|
aciAccountData.getPreKeyStore().storePreKey(entry.getKey(), new PreKeyRecord(entry.getValue()));
|
||||||
} catch (InvalidMessageException e) {
|
} catch (InvalidMessageException e) {
|
||||||
logger.warn("Failed to migrate pre key, ignoring", e);
|
logger.warn("Failed to migrate pre key, ignoring", e);
|
||||||
|
@ -840,6 +841,7 @@ public class SignalAccount implements Closeable {
|
||||||
logger.debug("Migrating legacy signed pre key store.");
|
logger.debug("Migrating legacy signed pre key store.");
|
||||||
for (var entry : legacySignalProtocolStore.getLegacySignedPreKeyStore().getSignedPreKeys().entrySet()) {
|
for (var entry : legacySignalProtocolStore.getLegacySignedPreKeyStore().getSignedPreKeys().entrySet()) {
|
||||||
try {
|
try {
|
||||||
|
aciAccountData.getSignedPreKeyStore().removeAllSignedPreKeys();
|
||||||
aciAccountData.getSignedPreKeyStore()
|
aciAccountData.getSignedPreKeyStore()
|
||||||
.storeSignedPreKey(entry.getKey(), new SignedPreKeyRecord(entry.getValue()));
|
.storeSignedPreKey(entry.getKey(), new SignedPreKeyRecord(entry.getValue()));
|
||||||
} catch (InvalidMessageException e) {
|
} catch (InvalidMessageException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue