Skip to content

Commit

Permalink
SAS - Device Verification Adjustments (#301)
Browse files Browse the repository at this point in the history
- remove "share without verifying" option
- start directly the verification based on emojis (without mentioning the legacy verification)
- change the strings to focus on user's devices verification
- Update the strings displayed during the legacy verification screen
- Adjust layout
- Update message when verification is cancelled
- Bug Fix - DeviceVerificationVerifyViewController: the waitingPartnerLabel label was never displayed
- Update the incoming request display
  • Loading branch information
giomfo authored May 25, 2020
1 parent 60a4661 commit b3b969f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 63 deletions.
17 changes: 9 additions & 8 deletions Riot/Assets/fr.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -692,23 +692,23 @@
// MARK: - Device Verification
"device_verification_title" = "Vérifier l’appareil";
"device_verification_security_advice" = "Pour une sécurité maximale, nous vous recommandons de faire cela en personne ou d’utiliser un autre moyen sûr de communication";
"device_verification_cancelled" = "L’autre personne a annulé la vérification.";
"device_verification_cancelled" = "La vérification a été annulée sur l’autre appareil.";
"device_verification_cancelled_by_me" = "La vérification a été annulée. Motif : %@";
"device_verification_error_cannot_load_device" = "Impossible de charger les informations de l’appareil.";
// Mark: Incoming
"device_verification_incoming_title" = "Demande de vérification entrante";
"device_verification_incoming_description_1" = "Vérifier cet appareil pour que ce soit un appareil de confiance. Faire confiance aux appareils de vos partenaires vous apporte une tranquillité d’esprit quand vous utilisez des messages chiffrés de bout en bout.";
"device_verification_incoming_description_1" = "L’un de vos appareils souhaite vérifier votre appareil actuel. En effectuant cette vérification, un lien de confiance s’établira entre vos deux appareils afin de faciliter le partage de clés de chiffrement.";
"device_verification_incoming_description_2" = "En vérifiant cet appareil, il sera marqué comme appareil de confiance, et le vôtre sera aussi marqué comme appareil de confiance pour votre partenaire.";
// MARK: Start
"device_verification_start_title" = "Vérifier en comparant une chaîne de caractères courte";
"device_verification_start_wait_partner" = "Nous attendons que le partenaire accepte…";
"device_verification_start_use_legacy" = "Rien n'apparaît ? Certains clients ne prennent pas encore en charge la vérification interactive. Utilisez la vérification traditionnelle.";
"device_verification_start_title" = "Vérifier en comparant une liste d'émojis";
"device_verification_start_wait_partner" = "Merci d'accepter la demande sur l'appareil à vérifier…";
"device_verification_start_use_legacy" = "Il est possible que la demande ne s'affiche pas sur cet appareil, car certaines versions de l'application ne prennent pas en charge la vérification interactive. Nous vous invitions alors à utiliser la vérification traditionnelle.";
"device_verification_start_verify_button" = "Commencer la vérification";
"device_verification_start_use_legacy_action" = "Utiliser la vérification traditionnelle";
// MARK: Verify
"device_verification_verify_title_emoji" = "Vérifier cet appareil en confirmant que les émojis suivant apparaissent sur l’écran de votre partenaire";
"device_verification_verify_title_number" = "Vérifier cet utilisateur en confirmant que les chiffres suivant apparaissent sur l’écran de votre partenaire";
"device_verification_verify_wait_partner" = "Nous attendons la confirmation de votre partenaire…";
"device_verification_verify_title_emoji" = "Vérifiez l’appareil en confirmant que les émojis suivants apparaissent également sur son écran";
"device_verification_verify_title_number" = "Vérifiez l’appareil en confirmant que les chiffres suivant apparaissent également sur son écran";
"device_verification_verify_wait_partner" = "Attente de la confirmation de l’autre appareil…";
// MARK: Verified
"device_verification_verified_title" = "Vérifié !";
"device_verification_verified_description_1" = "Vous avez bien vérifié cet appareil.";
Expand Down Expand Up @@ -964,6 +964,7 @@
"e2e_passphrase_not_match" = "Les phrases secrète doivent être identiques";
"e2e_passphrase_create" = "Créer la phrase secrète";
// Encryption information
"room_event_encryption_verify_message" = "Pour valider que vous pouvez faire confiance à cet appareil, merci de vérifier que la clé que vous voyez dans les Paramètres Utilisateur de cet appareil correspond à la clé ci-dessous :\n\n Nom de l'appareil : %@\n Identifiant de l'appareil : %@\n Clé de l'appareil : %@\n\nSi les clés correspondent, cliquer sur le bouton Vérifier ci-dessous.";
"room_event_encryption_info_verify" = "Vérifier...";
"room_event_encryption_info_unverify" = "A revérifier";
"room_event_encryption_info_block" = "Bloquer";
Expand Down
36 changes: 18 additions & 18 deletions Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ - (void)show
[self showVerificationView];
}
}]];

[_alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"e2e_room_key_request_share_without_verifying", @"Vector", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {

if (weakSelf)
{
typeof(self) self = weakSelf;

self->_alertController = nil;

// Accept the received requests from this device
[self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{

onComplete();
}];
}
}]];
// Tchap remove "share without verifying" option
// [_alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"e2e_room_key_request_share_without_verifying", @"Vector", nil)
// style:UIAlertActionStyleDefault
// handler:^(UIAlertAction * action) {
//
// if (weakSelf)
// {
// typeof(self) self = weakSelf;
//
// self->_alertController = nil;
//
// // Accept the received requests from this device
// [self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{
//
// onComplete();
// }];
// }
// }]];

[_alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"e2e_room_key_request_ignore_request", @"Vector", nil)
style:UIAlertActionStyleDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ final class DeviceVerificationIncomingViewController: UIViewController {
self.titleLabel.text = VectorL10n.deviceVerificationIncomingTitle
self.description1Label.text = VectorL10n.deviceVerificationIncomingDescription1
self.description2Label.text = VectorL10n.deviceVerificationIncomingDescription2

// Tchap keep visible only one description
self.description2Label.isHidden = true

self.continueButton.setTitle(VectorL10n.continue, for: .normal)

if let avatarImageView = self.avatarImageView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--Device Verification Start View Controller-->
<scene sceneID="mt5-wz-YKA">
<objects>
<viewController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="V8j-Lb-PgC" customClass="DeviceVerificationStartViewController" customModule="Riot" customModuleProvider="target" sceneMemberID="viewController">
<viewController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="V8j-Lb-PgC" customClass="DeviceVerificationStartViewController" customModule="Tchap" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="EL9-GA-lwo">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -22,10 +22,10 @@
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7g-um-WO4">
<rect key="frame" x="0.0" y="0.0" width="375" height="494"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="424"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="voD-3Q-ryt">
<rect key="frame" x="0.0" y="0.0" width="375" height="494"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="424"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Verify by comparing a short text string" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="he8-pl-xE9">
<rect key="frame" x="20" y="35" width="335" height="41"/>
Expand All @@ -37,16 +37,16 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="For maximum security, we recommend you do this in person or use another trusted means of communication." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bxI-mu-qng">
<rect key="frame" x="20" y="86" width="335" height="80"/>
<rect key="frame" x="20" y="86" width="335" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="80" id="Y2u-fJ-idS"/>
<constraint firstAttribute="height" constant="10" id="Y2u-fJ-idS"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Nothing appearing? Not all clients supports interactive verification yet. Use legacy verification." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xlN-AB-1V0">
<rect key="frame" x="20" y="316" width="335" height="100"/>
<rect key="frame" x="20" y="246" width="335" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="Pes-rZ-lpS"/>
<constraint firstAttribute="width" constant="335" id="caQ-aT-Sw4"/>
Expand All @@ -56,7 +56,7 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DtR-jx-UKY">
<rect key="frame" x="0.0" y="366" width="375" height="50"/>
<rect key="frame" x="0.0" y="296" width="375" height="50"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DOt-5E-FjF">
<rect key="frame" x="20" y="10" width="335" height="30"/>
Expand All @@ -79,7 +79,7 @@
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EBO-vX-zj4">
<rect key="frame" x="20" y="424" width="335" height="50"/>
<rect key="frame" x="20" y="354" width="335" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="oyt-F3-W0L"/>
</constraints>
Expand All @@ -91,7 +91,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting for partner to accept..." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6yX-xD-4X5">
<rect key="frame" x="20" y="213" width="335" height="54"/>
<rect key="frame" x="20" y="143" width="335" height="54"/>
<constraints>
<constraint firstAttribute="width" constant="335" id="9C0-ev-AVw"/>
<constraint firstAttribute="height" constant="54" id="pta-eP-0yH"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ final class DeviceVerificationStartViewController: UIViewController {
self.update(theme: self.theme)

self.viewModel.viewDelegate = self

// Tchap: start directly the verification based on emojis
self.viewModel.process(viewAction: .beginVerifying)
}

override var preferredStatusBarStyle: UIStatusBarStyle {
Expand Down Expand Up @@ -125,6 +128,12 @@ final class DeviceVerificationStartViewController: UIViewController {

self.verifyButton.setTitle(VectorL10n.deviceVerificationStartVerifyButton, for: .normal)
self.useLegacyVerificationButton.setTitle(VectorL10n.deviceVerificationStartUseLegacyAction, for: .normal)

// Tchap: hide the security remark (useless in case of self-device verification)
self.informationLabel.isHidden = true
// Tchap: hide button by default
self.verifyButtonBackgroundView.isHidden = true
self.useLegacyVerificationButton.isHidden = true
}

private func render(viewState: DeviceVerificationStartViewState) {
Expand Down Expand Up @@ -154,6 +163,8 @@ final class DeviceVerificationStartViewController: UIViewController {
self.verifyButtonBackgroundView.isHidden = true
self.waitingPartnerLabel.isHidden = false
self.useLegacyVerificationLabel.isHidden = false
// Tchap: show legacy verifcation here
self.useLegacyVerificationButton.isHidden = false
}

private func renderVerifyUsingLegacy(session: MXSession, deviceInfo: MXDeviceInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ final class DeviceVerificationVerifiedViewController: UIViewController {
self.titleLabel.text = VectorL10n.deviceVerificationVerifiedTitle
self.description1Label.text = VectorL10n.deviceVerificationVerifiedDescription1
self.description2Label.text = VectorL10n.deviceVerificationVerifiedDescription2
self.description2Label.isHidden = true

self.okButton.setTitle(VectorL10n.deviceVerificationVerifiedGotItButton, for: .normal)
}
Expand Down
Loading

0 comments on commit b3b969f

Please sign in to comment.