Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help item in bottom sheet verification #1125

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1113.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Améliorer l'explication pour la génération d'un nouveau code de récupération.
1 change: 1 addition & 0 deletions changelog.d/1116.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faciliter l'accès à l'aide sur la vérification d'appareil
4 changes: 2 additions & 2 deletions library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@
<string name="power_level_edit_title">Définir le rôle</string>
<string name="secure_backup_reset_no_history">Vous redémarrerez sans aucun historique, message, appareil ou utilisateurs connus</string>
<string name="secure_backup_reset_if_you_reset_all">Si vous réinitialisez tout</string>
<string name="secure_backup_reset_all_no_other_devices">Uniquement si vous avez perdu votre Code et n\'avez aucun autre appareil connecté à ${app_name}.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices">Uniquement si vous avez perdu votre code et n\'avez aucun autre appareil connecté à ${app_name}.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all">Réinitialiser tout</string>
<string name="bad_passphrase_key_reset_all_action">Générer un nouveau Code de Récupération</string> <!-- Tchap: Use custom string -->
<string name="error_saving_media_file">Impossible d’enregistrer le fichier multimédia</string>
Expand Down Expand Up @@ -2940,7 +2940,7 @@
<string name="pill_message_from_unknown_user">Message</string>
<string name="pill_message_from_user">Message de %s</string>
<string name="encrypted_by_deleted">Chiffré par un appareil supprimé</string>
<string name="secure_backup_reset_danger_warning">Veuillez ne continuer que si vous êtes certain d’avoir perdu tous vos autres appareils et votre Code de Récupération.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_danger_warning">Veuillez continuer uniquement si vous êtes certain·e d’avoir perdu votre Code de Récupération et qu’aucun autres appareils n’a accès à l’historique de vos messages.</string> <!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices_long">La réinitialisation ne peut pas être annulée. Vous n’aurez plus accès à vos anciens messages chiffrés.</string> <!-- Tchap: Use custom string -->
<string name="verification_not_found">La demande de vérification n’a pas été trouvée. Elle a peut-être été annulée, ou prise en charge dans une autre session.</string>
<string name="verification_request_was_sent">Une demande de vérification a été envoyée. Ouvrez ${app_name} sur l’un de vos autres appareils pour accepter et commencer la vérification.</string> <!-- Tchap: Use custom string -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">La vérification de votre nouvelle session a échoué.</string>
<string name="tchap_verification_get_help">Obtenir de l’aide</string>

<!-- Connectivity -->
<string name="tchap_no_connection_service_status">Voir l’état du service</string>
Expand Down
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,7 @@
<string name="failed_to_access_secure_storage">Failed to access secure storage</string>
<string name="bad_passphrase_key_reset_all_action">Lost your Recovery Code? Generate a new one.</string><!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all">Reset everything</string>
<string name="secure_backup_reset_all_no_other_devices">Only do this if you have no other device you can verify this device with.</string>
<string name="secure_backup_reset_all_no_other_devices">Only do this if you lost your recovery code and you have no other device connected to ${app_name}.</string><!-- Tchap: Use custom string -->
<string name="secure_backup_reset_all_no_other_devices_long">Resetting your verification keys cannot be undone. After resetting, you won\'t have access to old encrypted messages, and any friends who have previously verified you will see security warnings until you re-verify with them.</string>
<!-- TODO TO BE REMOVED -->
<string tools:ignore="UnusedResources" name="secure_backup_reset_if_you_reset_all">If you reset everything</string>
Expand Down
1 change: 1 addition & 0 deletions library/ui-strings/src/main/res/values/strings_tchap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">Failed to verify your new session.</string>
<string name="tchap_verification_get_help">Get help</string>

<!-- Connectivity -->
<string name="tchap_no_connection_service_status">View the status of services</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SelfVerificationController @Inject constructor(
) : BaseEpoxyVerificationController(stringProvider, colorProvider, eventHtmlRenderer) {

interface InteractionListener : BaseEpoxyVerificationController.InteractionListener {
fun onClickHelp()
fun onClickRecoverFromPassphrase()
fun onClickSkip()
fun onClickResetSecurity()
Expand Down Expand Up @@ -320,6 +321,15 @@ class SelfVerificationController @Inject constructor(
listener { host.selfVerificationListener?.onClickResetSecurity() }
}

bottomSheetVerificationActionItem {
id("help")
title(host.stringProvider.getString(CommonStrings.tchap_verification_get_help))
titleColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorError))
iconRes(R.drawable.ic_arrow_right)
iconColor(host.colorProvider.getColorFromAttribute(com.google.android.material.R.attr.colorError))
listener { host.selfVerificationListener?.onClickHelp() }
}

if (!state.isVerificationRequired) {
bottomSheetDividerItem {
id("reset_div")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.core.utils.PERMISSIONS_FOR_TAKING_PHOTO
import im.vector.app.core.utils.checkPermissions
import im.vector.app.core.utils.onPermissionDeniedDialog
import im.vector.app.core.utils.openUrlInChromeCustomTab
import im.vector.app.core.utils.registerForPermissionsResult
import im.vector.app.databinding.BottomSheetVerificationChildFragmentBinding
import im.vector.app.features.crypto.verification.VerificationAction
import im.vector.app.features.qrcode.QrCodeScannerActivity
import im.vector.app.features.settings.VectorSettingsUrls
import im.vector.lib.strings.CommonStrings
import org.matrix.android.sdk.api.session.crypto.verification.EVerificationState
import timber.log.Timber
Expand Down Expand Up @@ -94,6 +96,10 @@ class SelfVerificationFragment : VectorBaseFragment<BottomSheetVerificationChild
controller.update(state)
}

override fun onClickHelp() {
openUrlInChromeCustomTab(requireContext(), null, TCHAP_FAQ_VERIFICATION_URL)
}

override fun onClickRecoverFromPassphrase() {
viewModel.handle(VerificationAction.VerifyFromPassphrase)
}
Expand Down Expand Up @@ -235,4 +241,9 @@ class SelfVerificationFragment : VectorBaseFragment<BottomSheetVerificationChild
}
}
}

companion object {
private const val TCHAP_FAQ_VERIFICATION_URL =
"${VectorSettingsUrls.HELP}/fr/article/comment-verifier-un-nouvel-appareil-sur-tchap-xm0b0y/"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import im.vector.app.features.home.room.detail.timeline.helper.MessageItemAttrib
import im.vector.app.features.home.room.detail.timeline.item.MessageTextItem_
import im.vector.app.features.home.room.detail.timeline.tools.createLinkMovementMethod
import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.VectorSettingsUrls
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
import im.vector.lib.strings.CommonStrings
import me.gujun.android.span.image
Expand Down Expand Up @@ -139,6 +140,6 @@ class EncryptedItemFactory @Inject constructor(

companion object {
private const val TCHAP_FAQ_UTD_URL =
"https://aide.tchap.beta.gouv.fr/fr/article/dechiffrement-impossible-de-mes-messages-comment-y-remedier-android-m6e371/"
"${VectorSettingsUrls.HELP}/fr/article/dechiffrement-impossible-de-mes-messages-comment-y-remedier-android-m6e371/"
}
}
Loading