From d7054511d470509fcdba1c76ea106207042e5c39 Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Mon, 5 Dec 2022 17:20:20 +0100 Subject: [PATCH 1/3] Update copies --- Riot/Assets/en.lproj/Vector.strings | 3 ++- Riot/Generated/Strings.swift | 6 +++++- .../UserSessions/Common/View/UserSessionCardViewData.swift | 2 +- .../Coordinator/UserSessionsFlowCoordinator.swift | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 2413ab8095..049c89b89f 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -2459,7 +2459,7 @@ To enable access, tap Settings> Location and select Always"; "user_session_unverified_additional_info" = "Verify your current session for enhanced secure messaging."; "user_session_verification_unknown_additional_info" = "Verify your current session to reveal this session's verification status."; "user_other_session_unverified_additional_info" = "Verify or sign out from this session for best security and reliability."; -"user_other_session_permanently_unverified_additional_info" = "This session cannot be verified because it does not support encryption."; +"user_other_session_permanently_unverified_additional_info" = "This session doesn’t support encryption and thus can't be verified."; "user_other_session_verified_additional_info" = "This session is ready for secure messaging."; "user_session_push_notifications" = "Push notifications"; "user_session_push_notifications_message" = "When turned on, this session will receive push notifications."; @@ -2468,6 +2468,7 @@ To enable access, tap Settings> Location and select Always"; "user_session_verified_session_description" = "Verified sessions are anywhere you are using Element after entering your passphrase or confirming your identity with another verified session.\n\nThis means that you have all the keys needed to unlock your encrypted messages and confirm to other users that you trust this session."; "user_session_unverified_session_title" = "Unverified session"; "user_session_unverified_session_description" = "Unverified sessions are sessions that have logged in with your credentials but not been cross-verified.\n\nYou should make especially certain that you recognise these sessions as they could represent an unauthorised use of your account."; +"user_session_permanently_unverified_session_description" = "This session doesn't support encryption, so it can't be verified.\n\nYou won't be able to participate in rooms where encryption is enabled when using this session.\n\nFor best security and privacy, it is recommended to use Matrix clients that support encryption."; "user_session_inactive_session_title" = "Inactive sessions"; "user_session_inactive_session_description" = "Inactive sessions are sessions you have not used in some time, but they continue to receive encryption keys.\n\nRemoving inactive sessions improves security and performance, and makes it easier for you to identify if a new session is suspicious."; "user_session_rename_session_title" = "Renaming sessions"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 03068cde6b..0566739405 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -8723,7 +8723,7 @@ public class VectorL10n: NSObject { public static var userOtherSessionNoVerifiedSessions: String { return VectorL10n.tr("Vector", "user_other_session_no_verified_sessions") } - /// This session cannot be verified because it does not support encryption. + /// This session doesn’t support encryption and thus can't be verified. public static var userOtherSessionPermanentlyUnverifiedAdditionalInfo: String { return VectorL10n.tr("Vector", "user_other_session_permanently_unverified_additional_info") } @@ -8855,6 +8855,10 @@ public class VectorL10n: NSObject { public static var userSessionOverviewSessionTitle: String { return VectorL10n.tr("Vector", "user_session_overview_session_title") } + /// This session doesn't support encryption, so it can't be verified.\n\nYou won't be able to participate in rooms where encryption is enabled when using this session.\n\nFor best security and privacy, it is recommended to use Matrix clients that support encryption. + public static var userSessionPermanentlyUnverifiedSessionDescription: String { + return VectorL10n.tr("Vector", "user_session_permanently_unverified_session_description") + } /// Push notifications public static var userSessionPushNotifications: String { return VectorL10n.tr("Vector", "user_session_push_notifications") diff --git a/RiotSwiftUI/Modules/UserSessions/Common/View/UserSessionCardViewData.swift b/RiotSwiftUI/Modules/UserSessions/Common/View/UserSessionCardViewData.swift index d997567f3b..79cd2d8120 100644 --- a/RiotSwiftUI/Modules/UserSessions/Common/View/UserSessionCardViewData.swift +++ b/RiotSwiftUI/Modules/UserSessions/Common/View/UserSessionCardViewData.swift @@ -86,7 +86,7 @@ struct UserSessionCardViewData { case .unverified: return isCurrentSessionDisplayMode ? VectorL10n.userSessionUnverifiedAdditionalInfo : VectorL10n.userOtherSessionUnverifiedAdditionalInfo + " %@" case .permanentlyUnverified: - return VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo + return isCurrentSessionDisplayMode ? VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo : VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo + " %@" case .unknown: return VectorL10n.userSessionVerificationUnknownAdditionalInfo } diff --git a/RiotSwiftUI/Modules/UserSessions/Coordinator/UserSessionsFlowCoordinator.swift b/RiotSwiftUI/Modules/UserSessions/Coordinator/UserSessionsFlowCoordinator.swift index 76c1be95b3..79fd9e5738 100644 --- a/RiotSwiftUI/Modules/UserSessions/Coordinator/UserSessionsFlowCoordinator.swift +++ b/RiotSwiftUI/Modules/UserSessions/Coordinator/UserSessionsFlowCoordinator.swift @@ -476,8 +476,10 @@ private extension UserSessionInfo { var bottomSheetDescription: String { switch verificationState { - case .unverified, .permanentlyUnverified: + case .unverified: return VectorL10n.userSessionUnverifiedSessionDescription + case .permanentlyUnverified: + return VectorL10n.userSessionPermanentlyUnverifiedSessionDescription case .verified: return VectorL10n.userSessionVerifiedSessionDescription case .unknown: From 7e3724298f30e17e660195d2b6dea2dae35658f0 Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Mon, 5 Dec 2022 17:24:27 +0100 Subject: [PATCH 2/3] Add changelog.d file --- changelog.d/pr-7138.change | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/pr-7138.change diff --git a/changelog.d/pr-7138.change b/changelog.d/pr-7138.change new file mode 100644 index 0000000000..ae9975491f --- /dev/null +++ b/changelog.d/pr-7138.change @@ -0,0 +1 @@ +Update unverifiable sessions copies in the Device Manager. From 3a45ba4d01c30bde4ffb17e0ad047abdae9fdd8d Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Mon, 5 Dec 2022 19:43:29 +0100 Subject: [PATCH 3/3] Fix test --- .../Test/UI/UserSessionOverviewUITests.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/Test/UI/UserSessionOverviewUITests.swift b/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/Test/UI/UserSessionOverviewUITests.swift index 746fa38ba9..643c28cbe9 100644 --- a/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/Test/UI/UserSessionOverviewUITests.swift +++ b/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/Test/UI/UserSessionOverviewUITests.swift @@ -96,6 +96,7 @@ class UserSessionOverviewUITests: MockScreenTestCase { func test_whenPermanentlySessionSelected_copyIsCorrect() { app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession(sessionState: .permanentlyUnverified).title) - XCTAssertTrue(app.buttons[VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo].exists) + let buttonId = "\(VectorL10n.userOtherSessionPermanentlyUnverifiedAdditionalInfo) \(VectorL10n.userSessionLearnMore)" + XCTAssertTrue(app.buttons[buttonId].exists) } }