Skip to content

Commit

Permalink
Update UTD error message (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle authored Oct 25, 2023
1 parent 5aa86fe commit b248ca2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog.d/984.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modification du message d'information quand les messages sont verrouillés
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@
<string name="crypto_error_withheld_unverified">Vous ne pouvez pas accéder à ce message car l’envoyeur n’a pas confiance en votre appareil</string> <!-- Tchap: Use custom string -->
<string name="crypto_error_withheld_blacklisted">Impossible d’accéder à ce message car vous avez été bloqué par l’envoyeur</string>
<string name="notice_crypto_unable_to_decrypt_friendly_desc">À cause du chiffrement de bout en bout, vous pouvez avoir besoin d’attendre l’arrivée du message de quelqu’un car les clés Tchap ne vous ont pas été correctement envoyées.</string> <!-- Tchap: Use custom string -->
<string name="notice_crypto_unable_to_decrypt_friendly">Echec de déchiffrement : veuillez ouvrir ${app_name} sur vos autres appareils afin d’autoriser le partage de clés</string> <!-- Tchap: Use custom string -->
<string name="notice_crypto_unable_to_decrypt_friendly">Message verrouillé : ouvrez ${app_name} sur un autre appareil pour récupérer vos messages.</string> <!-- Tchap: Use custom string -->
<string name="notice_crypto_unable_to_decrypt_final">Vous n’avez pas accès à ce message</string>
<string name="room_settings_save_success">Vous avez bien changé les paramètres du salon</string>
<string name="room_settings_topic_hint">Sujet</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<string name="tchap_empty_room_no_permission_to_post">Votre destinataire a quitté le salon ou refusé votre invitation. Vous ne pouvez pas lui envoyer de message.</string>
<string name="tchap_discovery_section">Utilisateur trouvé</string>
<string name="tchap_login_reset_password_on">Réinitialiser le mot de passe</string>
<string name="tchap_notice_crypto_unable_to_decrypt_faq">Sinon, consultez la FAQ.</string>

<!-- tchap discussion -->
<string name="tchap_contact_external">Externe</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 @@ -2810,7 +2810,7 @@
<string name="room_settings_set_avatar">Set avatar</string>

<string name="notice_crypto_unable_to_decrypt_final">You cannot access this message</string>
<string name="notice_crypto_unable_to_decrypt_friendly">Failed to decrypt: please open ${app_name} on your other devices to allow key share request</string> <!-- Tchap: Use custom string -->
<string name="notice_crypto_unable_to_decrypt_friendly">Locked message: please open ${app_name} on another device to retrieve your messages.</string> <!-- Tchap: Use custom string -->
<string name="notice_crypto_unable_to_decrypt_friendly_desc">Due to end-to-end encryption, you might need to wait for someone\'s message to arrive because the encryption keys were not properly sent to you.</string>
<string name="crypto_error_withheld_blacklisted">You cannot access this message because you have been blocked by the sender</string>
<string name="crypto_error_withheld_unverified">You cannot access this message because your session is not trusted by the sender</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 @@ -36,6 +36,7 @@
<string name="tchap_empty_room_no_permission_to_post">Your recipient has left the room or has refused your invite. You cannot send him a message.</string>
<string name="tchap_discovery_section">Discovered user</string>
<string name="tchap_login_reset_password_on">Reset password</string>
<string name="tchap_notice_crypto_unable_to_decrypt_faq">Otherwise, open the FAQ.</string>

<!-- tchap discussion -->
<string name="tchap_contact_external">External</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@

package im.vector.app.features.home.room.detail.timeline.factory

import android.text.style.ClickableSpan
import android.view.View
import androidx.core.text.toSpannable
import im.vector.app.R
import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.DrawableProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.utils.openUrlInExternalBrowser
import im.vector.app.core.utils.tappableMatchingText
import im.vector.app.features.home.room.detail.timeline.helper.AvatarSizeProvider
import im.vector.app.features.home.room.detail.timeline.helper.MessageInformationDataFactory
import im.vector.app.features.home.room.detail.timeline.helper.MessageItemAttributesFactory
Expand Down Expand Up @@ -92,15 +97,18 @@ class EncryptedItemFactory @Inject constructor(
}
}
else -> {
// Tchap: Add faq link in unable to decrypt error
span {
drawableProvider.getDrawable(R.drawable.ic_clock, colorFromAttribute)?.let {
image(it, "baseline")
+" "
}
span(stringProvider.getString(R.string.notice_crypto_unable_to_decrypt_friendly)) {
textStyle = "italic"
textColor = colorFromAttribute
}
val faq = stringProvider.getString(R.string.tchap_notice_crypto_unable_to_decrypt_faq)
text = "${stringProvider.getString(R.string.notice_crypto_unable_to_decrypt_friendly)} $faq"
.toSpannable()
.tappableMatchingText(faq, object : ClickableSpan() {
override fun onClick(widget: View) {
openUrlInExternalBrowser(widget.context, TCHAP_FAQ_UTD_URL)
}
})
textStyle = "italic"
textColor = colorFromAttribute
}
}
}
Expand All @@ -127,4 +135,9 @@ class EncryptedItemFactory @Inject constructor(
else -> null
}
}

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/"
}
}

0 comments on commit b248ca2

Please sign in to comment.