Debug multi device revocation

pull/70/head
Niels Andriesse 6 years ago
parent e954933b66
commit 5fde64ef1e

@ -1,8 +1,8 @@
public extension OWSPrimaryStorage { public extension OWSPrimaryStorage {
private func getDeviceLinkCollection(for primaryDevice: String) -> String { private func getDeviceLinkCollection(for masterHexEncodedPublicKey: String) -> String {
return "LokiDeviceLinkCollection-\(primaryDevice)" return "LokiDeviceLinkCollection-\(masterHexEncodedPublicKey)"
} }
public func setDeviceLinks(_ deviceLinks: Set<DeviceLink>, in transaction: YapDatabaseReadWriteTransaction) { public func setDeviceLinks(_ deviceLinks: Set<DeviceLink>, in transaction: YapDatabaseReadWriteTransaction) {

@ -1196,11 +1196,11 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
[LKStorageAPI getDeviceLinksAssociatedWith:userHexEncodedPublicKey].thenOn(dispatch_get_main_queue(), ^(NSSet<LKDeviceLink *> *deviceLinks) { [LKStorageAPI getDeviceLinksAssociatedWith:userHexEncodedPublicKey].thenOn(dispatch_get_main_queue(), ^(NSSet<LKDeviceLink *> *deviceLinks) {
if (![deviceLinks contains:^BOOL(LKDeviceLink *deviceLink) { if ([deviceLinks contains:^BOOL(LKDeviceLink *deviceLink) {
return [deviceLink.master.hexEncodedPublicKey isEqual:senderHexEncodedPublicKey] && [deviceLink.slave.hexEncodedPublicKey isEqual:userHexEncodedPublicKey]; return [deviceLink.master.hexEncodedPublicKey isEqual:senderHexEncodedPublicKey] && [deviceLink.slave.hexEncodedPublicKey isEqual:userHexEncodedPublicKey];
}]) { }]) {
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"wasUnlinked"]; [NSUserDefaults.standardUserDefaults setBool:YES forKey:@"wasUnlinked"];
[NSNotificationCenter.defaultCenter postNotification:NSNotification.dataNukeRequested]; [NSNotificationCenter.defaultCenter postNotificationName:NSNotification.dataNukeRequested object:nil];
} }
}); });
} }

Loading…
Cancel
Save