Warn unknown devices: update the unknown devices list once a device has been verified

This commit is contained in:
manuroe
2017-02-15 11:12:07 +01:00
parent afb09b427a
commit fd86929f5e
2 changed files with 16 additions and 6 deletions
@@ -22,14 +22,10 @@
#import "VectorDesignValues.h"
#import "EncryptionInfoView.h"
@interface UsersDevicesViewController ()
{
MXUsersDevicesMap<MXDeviceInfo*> *usersDevices;
MXSession *mxSession;
EncryptionInfoView *encryptionInfoView;
}
@end
@@ -150,9 +146,11 @@
if (verificationStatus == MXDeviceVerified)
{
// Prompt the user before marking as verified the device.
encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceTableViewCell.deviceInfo andMatrixSession:mxSession];
EncryptionInfoView *encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceTableViewCell.deviceInfo andMatrixSession:mxSession];
[encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton];
encryptionInfoView.delegate = self;
// Add shadow on added view
encryptionInfoView.layer.cornerRadius = 5;
encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1);
@@ -208,6 +206,17 @@
}
}
#pragma mark - MXKEncryptionInfoViewDelegate
- (void)encryptionInfoView:(MXKEncryptionInfoView *)encryptionInfoView didDeviceInfoVerifiedChange:(MXDeviceInfo *)deviceInfo
{
// Update our map
MXDeviceInfo *device = [usersDevices objectForDevice:deviceInfo.deviceId forUser:deviceInfo.userId];
device.verified = deviceInfo.verified;
[self.tableView reloadData];
}
#pragma mark - User actions
- (IBAction)onCancel:(id)sender