Refactor DeviceVerification prefix classes to KeyVerification where needed. And move key verification related classes into the same module KeyVerification.

This commit is contained in:
SBiOSoftWhare
2020-03-18 17:39:26 +01:00
parent 732ae10eb4
commit 25e8f7fccf
91 changed files with 819 additions and 803 deletions
@@ -39,7 +39,7 @@
@property (nonatomic, weak) id keyVerificationRequestDidChangeNotificationObserver;
// Observe key verification transaction changes
@property (nonatomic, weak) id deviceVerificationTransactionDidChangeNotificationObserver;
@property (nonatomic, weak) id keyVerificationTransactionDidChangeNotificationObserver;
// Timer used to debounce cells refresh
@property (nonatomic, strong) NSTimer *refreshCellsTimer;
@@ -86,7 +86,7 @@
}];
[self registerKeyVerificationRequestNotification];
[self registerDeviceVerificationTransactionNotification];
[self registerKeyVerificationTransactionNotification];
[self registerTrustLevelDidChangeNotifications];
self.encryptionTrustLevel = RoomEncryptionTrustLevelUnknown;
@@ -156,9 +156,9 @@
[[NSNotificationCenter defaultCenter] removeObserver:self.keyVerificationRequestDidChangeNotificationObserver];
}
if (self.deviceVerificationTransactionDidChangeNotificationObserver)
if (self.keyVerificationTransactionDidChangeNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:self.deviceVerificationTransactionDidChangeNotificationObserver];
[[NSNotificationCenter defaultCenter] removeObserver:self.keyVerificationTransactionDidChangeNotificationObserver];
}
[super destroy];
@@ -670,18 +670,18 @@
}];
}
- (void)registerDeviceVerificationTransactionNotification
- (void)registerKeyVerificationTransactionNotification
{
self.deviceVerificationTransactionDidChangeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:MXKeyVerificationTransactionDidChangeNotification
self.keyVerificationTransactionDidChangeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:MXKeyVerificationTransactionDidChangeNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *notification)
{
MXKeyVerificationTransaction *deviceVerificationTransaction = (MXKeyVerificationTransaction*)notification.object;
MXKeyVerificationTransaction *keyVerificationTransaction = (MXKeyVerificationTransaction*)notification.object;
if ([deviceVerificationTransaction.dmRoomId isEqualToString:self.roomId])
if ([keyVerificationTransaction.dmRoomId isEqualToString:self.roomId])
{
RoomBubbleCellData *roomBubbleCellData = [self roomBubbleCellDataForEventId:deviceVerificationTransaction.dmEventId];
RoomBubbleCellData *roomBubbleCellData = [self roomBubbleCellDataForEventId:keyVerificationTransaction.dmEventId];
roomBubbleCellData.isKeyVerificationOperationPending = NO;
roomBubbleCellData.keyVerification = nil;