mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Session verification fixes and bump SDK to v0.0.1-october23 (#1954)
* Fixes vector-im/element-x-ios/issues/1868 Incorrect `is_verified` flag after successfully running verification flow - the inner user_identity isn't automatically updated when the flow finishes, needs to be fetched again from encryption - also replaces `UserIdentity.is_verified` with `Device.is_cross_signed_by_owner` - depends on matrix-org/matrix-rust-sdk/pull/2775 --------- Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -41,7 +41,7 @@ struct SettingsScreenViewState: BindableState {
|
||||
var accountSessionsListURL: URL?
|
||||
var userAvatarURL: URL?
|
||||
var userDisplayName: String?
|
||||
var isSessionVerified: Bool
|
||||
var isSessionVerified = false
|
||||
var chatBackupEnabled = false
|
||||
var showSecureBackupBadge = false
|
||||
var showAppLockSettings: Bool
|
||||
|
||||
@@ -33,16 +33,10 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
self.userSession = userSession
|
||||
self.appSettings = appSettings
|
||||
|
||||
var isSessionVerified = true
|
||||
if let sessionVerificationController = userSession.sessionVerificationController {
|
||||
isSessionVerified = sessionVerificationController.isVerified
|
||||
}
|
||||
|
||||
super.init(initialViewState: .init(deviceID: userSession.deviceID,
|
||||
userID: userSession.userID,
|
||||
accountProfileURL: userSession.clientProxy.accountURL(action: .profile),
|
||||
accountSessionsListURL: userSession.clientProxy.accountURL(action: .sessionsList),
|
||||
isSessionVerified: isSessionVerified,
|
||||
showAppLockSettings: appSettings.appLockFlowEnabled,
|
||||
showDeveloperOptions: appSettings.canShowDeveloperOptions),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
@@ -77,6 +71,11 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
Task {
|
||||
await userSession.clientProxy.loadUserAvatarURL()
|
||||
await userSession.clientProxy.loadUserDisplayName()
|
||||
|
||||
if let sessionVerificationController = userSession.sessionVerificationController,
|
||||
case let .success(isVerified) = await sessionVerificationController.isVerified() {
|
||||
state.isSessionVerified = isVerified
|
||||
}
|
||||
}
|
||||
|
||||
userSession.callbacks
|
||||
|
||||
@@ -247,7 +247,7 @@ private extension TimelineStyle {
|
||||
struct SettingsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = {
|
||||
let verificationController = SessionVerificationControllerProxyMock()
|
||||
verificationController.isVerified = false
|
||||
verificationController.isVerifiedReturnValue = .success(false)
|
||||
let userSession = MockUserSession(sessionVerificationController: verificationController,
|
||||
clientProxy: MockClientProxy(userID: "@userid:example.com",
|
||||
deviceID: "AAAAAAAAAAA"),
|
||||
|
||||
Reference in New Issue
Block a user