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

Changer le message d'erreur en cas de problème de déchiffrement #978

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
2 changes: 1 addition & 1 deletion Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ To enable access, tap Settings> Location and select Always";
"notice_room_history_visible_to_members_from_joined_point" = "%@ made future room history visible to all room members, from the point they joined.";
"notice_room_history_visible_to_members_from_joined_point_for_dm" = "%@ made future messages visible to everyone, from when they joined.";
"notice_crypto_unable_to_decrypt" = "** Unable to decrypt: %@ **";
"notice_crypto_error_unknown_inbound_session_id" = "The sender's session has not sent us the keys for this message.";
"notice_crypto_error_unknown_inbound_session_id" = "Deciphering…"; // Tchap
"notice_sticker" = "sticker";
"notice_in_reply_to" = "In reply to";
"notice_voice_broadcast_live" = "Live broadcast";
Expand Down
3 changes: 1 addition & 2 deletions Riot/Assets/fr.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@
"notice_room_history_visible_to_members_from_invited_point" = "%@ a rendu l’historique futur du salon visible à tous les membres, à partir du moment où ils ont été invités.";
"notice_room_history_visible_to_members_from_joined_point" = "%@ a rendu l’historique futur du salon visible à tous les membres, à partir de leur arrivée.";
"notice_crypto_unable_to_decrypt" = "** Déchiffrement impossible : %@ **";
"notice_crypto_error_unknown_inbound_session_id" = "La session de l’expéditeur ne nous a pas envoyé les clés pour ce message.";
"notice_crypto_error_unknown_inbound_session_id" = "Déchiffrement en cours…"; // Tchap
"notice_sticker" = "autocollant";
// room display name
"room_displayname_empty_room" = "Salon vide";
Expand Down Expand Up @@ -2797,4 +2797,3 @@
"local_contacts_access_discovery_warning" = "Afin d’afficher qui parmi vos contacts utilise déjà Tchap, nous pouvons exploiter les adresses e-mails de votre carnet d'adresse. Ces données ne seront pas mémorisées. Pour plus d'informations, veuillez consulter les Termes et Conditions disponibles dans les paramètres de l'application.";
// Events formatter
"notice_crypto_unable_to_decrypt" = "Message verrouillé."; // Tchap
"notice_crypto_error_unknown_inbound_session_id" = "Ouvrez Tchap sur un autre appareil pour récupérer vos messages."; // Tchap
9 changes: 8 additions & 1 deletion Riot/Utils/EventFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,10 @@ - (NSAttributedString *)unsafeAttributedStringFromEvent:(MXEvent *)event
// }]];

NSMutableAttributedString *attributedStringWithRerequestMessage = [attributedString mutableCopy];
// Tchap: Reset initial String to optimize error message for user
[attributedStringWithRerequestMessage.mutableString setString: [NSString stringWithFormat:@"%@\n", VectorL10n.noticeCryptoErrorUnknownInboundSessionId]];

[attributedStringWithRerequestMessage appendString:[NSString stringWithFormat:@" %@\n", VectorL10n.noticeCryptoErrorUnknownInboundSessionId]];
// [attributedStringWithRerequestMessage appendString:[NSString stringWithFormat:@" %@\n", VectorL10n.noticeCryptoErrorUnknownInboundSessionId]];
NSString *linkActionString = [NSString stringWithFormat:@"%@%@%@", EventFormatterFaqLinkAction,
EventFormatterLinkActionSeparator,
@"https://aide.tchap.beta.gouv.fr/fr/article/dechiffrement-impossible-de-mes-messages-comment-y-remedier-iphone-xotgv1"];
Expand All @@ -385,6 +387,11 @@ - (NSAttributedString *)unsafeAttributedStringFromEvent:(MXEvent *)event
NSUnderlineStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
}]];

[attributedStringWithRerequestMessage addAttributes:@{
NSForegroundColorAttributeName: [UIColor colorWithRed:106.0/255.0 green:106.0/255.0 blue:106.0/255.0 alpha:1.0],
NSFontAttributeName: self.encryptedMessagesTextFont,
} range:NSMakeRange(0, attributedStringWithRerequestMessage.length)];

attributedString = attributedStringWithRerequestMessage;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tchap/Assets/Localizations/fr.lproj/Tchap.strings
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@

////////////////////////////////////////////////////////////////////////////////
// MARK: Room Decryption error
"room_decryption_error_faq_link_message" = "Sinon, consulter cet article de FAQ.";
"room_decryption_error_faq_link_message" = "En savoir plus.";

////////////////////////////////////////////////////////////////////////////////
// MARK: Room Invite
Expand Down
1 change: 1 addition & 0 deletions changelog.d/976.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changer le message d'erreur affiché en cas de problème de déchiffrement
Loading