diff --git a/Vector/ViewController/UsersDevicesViewController.h b/Vector/ViewController/UsersDevicesViewController.h index 22905fc28..620bee7da 100644 --- a/Vector/ViewController/UsersDevicesViewController.h +++ b/Vector/ViewController/UsersDevicesViewController.h @@ -17,8 +17,9 @@ #import #import "DeviceTableViewCell.h" +#import "EncryptionInfoView.h" -@interface UsersDevicesViewController : MXKViewController +@interface UsersDevicesViewController : MXKViewController /** Display a map of users/devices. diff --git a/Vector/ViewController/UsersDevicesViewController.m b/Vector/ViewController/UsersDevicesViewController.m index b89079a7f..4cf87a4f2 100644 --- a/Vector/ViewController/UsersDevicesViewController.m +++ b/Vector/ViewController/UsersDevicesViewController.m @@ -22,14 +22,10 @@ #import "VectorDesignValues.h" -#import "EncryptionInfoView.h" - @interface UsersDevicesViewController () { MXUsersDevicesMap *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