Ignore already-locked accounts in PNI key cleanup operations
This commit is contained in:
parent
7cf89764e7
commit
287da6e7e3
|
@ -73,6 +73,7 @@ public class LockAccountsWithoutPniIdentityKeysCommand extends AbstractSinglePas
|
||||||
final AccountsManager accountsManager = getCommandDependencies().accountsManager();
|
final AccountsManager accountsManager = getCommandDependencies().accountsManager();
|
||||||
|
|
||||||
accounts
|
accounts
|
||||||
|
.filter(account -> !account.hasLockedCredentials())
|
||||||
.filter(account -> account.getIdentityKey(IdentityType.PNI) == null)
|
.filter(account -> account.getIdentityKey(IdentityType.PNI) == null)
|
||||||
.flatMap(accountWithoutPniIdentityKey -> {
|
.flatMap(accountWithoutPniIdentityKey -> {
|
||||||
final String platform = DevicePlatformUtil.getDevicePlatform(accountWithoutPniIdentityKey.getPrimaryDevice())
|
final String platform = DevicePlatformUtil.getDevicePlatform(accountWithoutPniIdentityKey.getPrimaryDevice())
|
||||||
|
|
|
@ -77,6 +77,7 @@ public class RemoveLinkedDevicesWithoutPniKeysCommand extends AbstractSinglePass
|
||||||
final KeysManager keysManager = getCommandDependencies().keysManager();
|
final KeysManager keysManager = getCommandDependencies().keysManager();
|
||||||
|
|
||||||
accounts
|
accounts
|
||||||
|
.filter(account -> !account.hasLockedCredentials())
|
||||||
.filter(account -> account.getDevices().size() > 1)
|
.filter(account -> account.getDevices().size() > 1)
|
||||||
.flatMap(account -> Flux.fromIterable(account.getDevices())
|
.flatMap(account -> Flux.fromIterable(account.getDevices())
|
||||||
.filter(device -> !device.isPrimary())
|
.filter(device -> !device.isPrimary())
|
||||||
|
|
Loading…
Reference in New Issue