diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index de7ea6bfc..10c9dc6cb 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -3733,8 +3733,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSString *deviceId = [pendingKeyRequests deviceIdsForUser:userId].firstObject; // Give the client a chance to refresh the device list - // Note: react-sdk does not do a force download - [mxSession.crypto downloadKeys:@[userId] success:^(MXUsersDevicesMap *usersDevicesInfoMap) { + [mxSession.crypto downloadKeys:@[userId] forceDownload:NO success:^(MXUsersDevicesMap *usersDevicesInfoMap) { MXDeviceInfo *deviceInfo = [usersDevicesInfoMap objectForDevice:deviceId forUser:userId]; if (deviceInfo) diff --git a/Riot/ViewController/RoomMemberDetailsViewController.m b/Riot/ViewController/RoomMemberDetailsViewController.m index cb5ba4a80..0f61f22fa 100644 --- a/Riot/ViewController/RoomMemberDetailsViewController.m +++ b/Riot/ViewController/RoomMemberDetailsViewController.m @@ -406,11 +406,28 @@ } // Retrieve member's devices - [self.mxRoom.mxSession.crypto devicesForUser:self.mxRoomMember.userId complete:^(NSArray *devices) { - devicesArray = devices; + NSString *userId = self.mxRoomMember.userId; + __weak typeof(self) weakSelf = self; - // Reload the full table to take into account a potential change on a device status. - [super updateMemberInfo]; + [self.mxRoom.mxSession.crypto downloadKeys:@[userId] forceDownload:NO success:^(MXUsersDevicesMap *usersDevicesInfoMap) { + + if (weakSelf) + { + // Restore the status bar + typeof(self) self = weakSelf; + + self->devicesArray = usersDevicesInfoMap.map[userId].allValues; + + // Reload the full table to take into account a potential change on a device status. + [super updateMemberInfo]; + } + + } failure:^(NSError *error) { + + NSLog(@"[RoomMemberDetailsVC] Crypto failed to download device info for user: %@", userId); + + // Notify MatrixKit user + [[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error]; }]; }