mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Remove previous prekeys when importing legacy prekeys
This commit is contained in:
parent
7aede7c17f
commit
2b150112ff
1 changed files with 2 additions and 2 deletions
|
@ -827,9 +827,9 @@ public class SignalAccount implements Closeable {
|
||||||
|
|
||||||
if (legacySignalProtocolStore != null && legacySignalProtocolStore.getLegacyPreKeyStore() != null) {
|
if (legacySignalProtocolStore != null && legacySignalProtocolStore.getLegacyPreKeyStore() != null) {
|
||||||
logger.debug("Migrating legacy pre key store.");
|
logger.debug("Migrating legacy pre key store.");
|
||||||
|
aciAccountData.getPreKeyStore().removeAllPreKeys();
|
||||||
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);
|
||||||
|
@ -839,9 +839,9 @@ public class SignalAccount implements Closeable {
|
||||||
|
|
||||||
if (legacySignalProtocolStore != null && legacySignalProtocolStore.getLegacySignedPreKeyStore() != null) {
|
if (legacySignalProtocolStore != null && legacySignalProtocolStore.getLegacySignedPreKeyStore() != null) {
|
||||||
logger.debug("Migrating legacy signed pre key store.");
|
logger.debug("Migrating legacy signed pre key store.");
|
||||||
|
aciAccountData.getSignedPreKeyStore().removeAllSignedPreKeys();
|
||||||
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