fix: Settings crash, photo preview before sending, incoming-content hardening
Settings crashed with a TypeError: the profile card passed a SepotFingerprint object where the localized string formatter expects a String (hidden behind a `dynamic` parameter). Also fixes RangeError in avatar initials (empty names, double spaces) and switches initials to grapheme clusters so emoji don't get split. New photo preview screen: a captured or picked photo no longer sends immediately — it opens in a preview with freehand drawing (7 colours, undo), draggable text overlay, 90° rotation and a caption field. Nothing leaves the device until Send is tapped. Incoming-content hardening: decryption and content processing are now separated in the delivery path. Once an envelope is decrypted the ratchet has advanced, so redelivery can never help — permanently malformed content (FormatException/TypeError) is acked and dropped instead of poisoning the queue on every reconnect. Attachment metadata now validates base64 of the crypto fields up front, and a corrupt inline thumbnail no longer breaks bubble rendering. PNG without real transparency (screenshots, edited photos) is now re-encoded as JPEG — several times smaller on the wire. Tests: 116 (new widget tests for Settings and the photo preview, AttachmentMeta wire validation).
This commit is contained in:
+37
-1
@@ -1698,5 +1698,41 @@
|
||||
"commonE2eBadgeFull": "End-to-end šifrováno",
|
||||
"@commonE2eBadgeFull": {
|
||||
"description": "Plná varianta badge šifrování (ikona zámku + text), zobrazuje se např. v hlavičce chatu / onboardingu."
|
||||
},
|
||||
"photoPreviewCaptionHint": "Přidat popisek…",
|
||||
"@photoPreviewCaptionHint": {
|
||||
"description": "hintText pole popisku na obrazovce náhledu fotky před odesláním"
|
||||
},
|
||||
"photoPreviewDraw": "Kreslit",
|
||||
"@photoPreviewDraw": {
|
||||
"description": "Tooltip nástroje kreslení prstem na náhledu fotky"
|
||||
},
|
||||
"photoPreviewAddText": "Přidat text",
|
||||
"@photoPreviewAddText": {
|
||||
"description": "Tooltip nástroje přidání textu na fotku"
|
||||
},
|
||||
"photoPreviewRotate": "Otočit",
|
||||
"@photoPreviewRotate": {
|
||||
"description": "Tooltip otočení fotky o 90°"
|
||||
},
|
||||
"photoPreviewUndo": "Zpět",
|
||||
"@photoPreviewUndo": {
|
||||
"description": "Tooltip vrácení posledního tahu kreslení"
|
||||
},
|
||||
"photoPreviewSend": "Poslat",
|
||||
"@photoPreviewSend": {
|
||||
"description": "Tooltip tlačítka odeslání fotky z náhledu"
|
||||
},
|
||||
"photoPreviewTextDialogTitle": "Text na fotce",
|
||||
"@photoPreviewTextDialogTitle": {
|
||||
"description": "Titulek dialogu pro zadání/úpravu textu na fotce"
|
||||
},
|
||||
"photoPreviewRemoveText": "Odebrat",
|
||||
"@photoPreviewRemoveText": {
|
||||
"description": "Tlačítko odebrání textu z fotky v dialogu úpravy"
|
||||
},
|
||||
"photoPreviewDecodeFailed": "Fotku se nepodařilo načíst",
|
||||
"@photoPreviewDecodeFailed": {
|
||||
"description": "SnackBar, když se vybraná fotka nedá dekódovat — náhled se zavře bez odeslání"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -348,5 +348,14 @@
|
||||
"contactsErrorAlreadyExists": "Kontakt existiert bereits",
|
||||
"commonAppTagline": "Privater Messenger",
|
||||
"commonE2eBadgeCompact": "E2E",
|
||||
"commonE2eBadgeFull": "Ende-zu-Ende-verschlüsselt"
|
||||
"commonE2eBadgeFull": "Ende-zu-Ende-verschlüsselt",
|
||||
"photoPreviewCaptionHint": "Bildunterschrift hinzufügen…",
|
||||
"photoPreviewDraw": "Zeichnen",
|
||||
"photoPreviewAddText": "Text hinzufügen",
|
||||
"photoPreviewRotate": "Drehen",
|
||||
"photoPreviewUndo": "Rückgängig",
|
||||
"photoPreviewSend": "Senden",
|
||||
"photoPreviewTextDialogTitle": "Text auf dem Foto",
|
||||
"photoPreviewRemoveText": "Entfernen",
|
||||
"photoPreviewDecodeFailed": "Foto konnte nicht geladen werden"
|
||||
}
|
||||
|
||||
+10
-1
@@ -348,5 +348,14 @@
|
||||
"contactsErrorAlreadyExists": "Contact already exists",
|
||||
"commonAppTagline": "Private messenger",
|
||||
"commonE2eBadgeCompact": "E2E",
|
||||
"commonE2eBadgeFull": "End-to-end encrypted"
|
||||
"commonE2eBadgeFull": "End-to-end encrypted",
|
||||
"photoPreviewCaptionHint": "Add a caption…",
|
||||
"photoPreviewDraw": "Draw",
|
||||
"photoPreviewAddText": "Add text",
|
||||
"photoPreviewRotate": "Rotate",
|
||||
"photoPreviewUndo": "Undo",
|
||||
"photoPreviewSend": "Send",
|
||||
"photoPreviewTextDialogTitle": "Text on photo",
|
||||
"photoPreviewRemoveText": "Remove",
|
||||
"photoPreviewDecodeFailed": "Couldn't load the photo"
|
||||
}
|
||||
|
||||
+10
-1
@@ -348,5 +348,14 @@
|
||||
"contactsErrorAlreadyExists": "Il contatto esiste già",
|
||||
"commonAppTagline": "Messenger privato",
|
||||
"commonE2eBadgeCompact": "E2E",
|
||||
"commonE2eBadgeFull": "Cifrato end-to-end"
|
||||
"commonE2eBadgeFull": "Cifrato end-to-end",
|
||||
"photoPreviewCaptionHint": "Aggiungi una didascalia…",
|
||||
"photoPreviewDraw": "Disegna",
|
||||
"photoPreviewAddText": "Aggiungi testo",
|
||||
"photoPreviewRotate": "Ruota",
|
||||
"photoPreviewUndo": "Annulla",
|
||||
"photoPreviewSend": "Invia",
|
||||
"photoPreviewTextDialogTitle": "Testo sulla foto",
|
||||
"photoPreviewRemoveText": "Rimuovi",
|
||||
"photoPreviewDecodeFailed": "Impossibile caricare la foto"
|
||||
}
|
||||
|
||||
+10
-1
@@ -348,5 +348,14 @@
|
||||
"contactsErrorAlreadyExists": "Контакт уже существует",
|
||||
"commonAppTagline": "Приватный мессенджер",
|
||||
"commonE2eBadgeCompact": "E2E",
|
||||
"commonE2eBadgeFull": "Сквозное шифрование"
|
||||
"commonE2eBadgeFull": "Сквозное шифрование",
|
||||
"photoPreviewCaptionHint": "Добавить подпись…",
|
||||
"photoPreviewDraw": "Рисовать",
|
||||
"photoPreviewAddText": "Добавить текст",
|
||||
"photoPreviewRotate": "Повернуть",
|
||||
"photoPreviewUndo": "Отменить",
|
||||
"photoPreviewSend": "Отправить",
|
||||
"photoPreviewTextDialogTitle": "Текст на фото",
|
||||
"photoPreviewRemoveText": "Удалить",
|
||||
"photoPreviewDecodeFailed": "Не удалось загрузить фото"
|
||||
}
|
||||
|
||||
@@ -2197,6 +2197,60 @@ abstract class AppLocalizations {
|
||||
/// In cs, this message translates to:
|
||||
/// **'End-to-end šifrováno'**
|
||||
String get commonE2eBadgeFull;
|
||||
|
||||
/// hintText pole popisku na obrazovce náhledu fotky před odesláním
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Přidat popisek…'**
|
||||
String get photoPreviewCaptionHint;
|
||||
|
||||
/// Tooltip nástroje kreslení prstem na náhledu fotky
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Kreslit'**
|
||||
String get photoPreviewDraw;
|
||||
|
||||
/// Tooltip nástroje přidání textu na fotku
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Přidat text'**
|
||||
String get photoPreviewAddText;
|
||||
|
||||
/// Tooltip otočení fotky o 90°
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Otočit'**
|
||||
String get photoPreviewRotate;
|
||||
|
||||
/// Tooltip vrácení posledního tahu kreslení
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Zpět'**
|
||||
String get photoPreviewUndo;
|
||||
|
||||
/// Tooltip tlačítka odeslání fotky z náhledu
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Poslat'**
|
||||
String get photoPreviewSend;
|
||||
|
||||
/// Titulek dialogu pro zadání/úpravu textu na fotce
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Text na fotce'**
|
||||
String get photoPreviewTextDialogTitle;
|
||||
|
||||
/// Tlačítko odebrání textu z fotky v dialogu úpravy
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Odebrat'**
|
||||
String get photoPreviewRemoveText;
|
||||
|
||||
/// SnackBar, když se vybraná fotka nedá dekódovat — náhled se zavře bez odeslání
|
||||
///
|
||||
/// In cs, this message translates to:
|
||||
/// **'Fotku se nepodařilo načíst'**
|
||||
String get photoPreviewDecodeFailed;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -1248,4 +1248,31 @@ class AppLocalizationsCs extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get commonE2eBadgeFull => 'End-to-end šifrováno';
|
||||
|
||||
@override
|
||||
String get photoPreviewCaptionHint => 'Přidat popisek…';
|
||||
|
||||
@override
|
||||
String get photoPreviewDraw => 'Kreslit';
|
||||
|
||||
@override
|
||||
String get photoPreviewAddText => 'Přidat text';
|
||||
|
||||
@override
|
||||
String get photoPreviewRotate => 'Otočit';
|
||||
|
||||
@override
|
||||
String get photoPreviewUndo => 'Zpět';
|
||||
|
||||
@override
|
||||
String get photoPreviewSend => 'Poslat';
|
||||
|
||||
@override
|
||||
String get photoPreviewTextDialogTitle => 'Text na fotce';
|
||||
|
||||
@override
|
||||
String get photoPreviewRemoveText => 'Odebrat';
|
||||
|
||||
@override
|
||||
String get photoPreviewDecodeFailed => 'Fotku se nepodařilo načíst';
|
||||
}
|
||||
|
||||
@@ -1270,4 +1270,31 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get commonE2eBadgeFull => 'Ende-zu-Ende-verschlüsselt';
|
||||
|
||||
@override
|
||||
String get photoPreviewCaptionHint => 'Bildunterschrift hinzufügen…';
|
||||
|
||||
@override
|
||||
String get photoPreviewDraw => 'Zeichnen';
|
||||
|
||||
@override
|
||||
String get photoPreviewAddText => 'Text hinzufügen';
|
||||
|
||||
@override
|
||||
String get photoPreviewRotate => 'Drehen';
|
||||
|
||||
@override
|
||||
String get photoPreviewUndo => 'Rückgängig';
|
||||
|
||||
@override
|
||||
String get photoPreviewSend => 'Senden';
|
||||
|
||||
@override
|
||||
String get photoPreviewTextDialogTitle => 'Text auf dem Foto';
|
||||
|
||||
@override
|
||||
String get photoPreviewRemoveText => 'Entfernen';
|
||||
|
||||
@override
|
||||
String get photoPreviewDecodeFailed => 'Foto konnte nicht geladen werden';
|
||||
}
|
||||
|
||||
@@ -1243,4 +1243,31 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get commonE2eBadgeFull => 'End-to-end encrypted';
|
||||
|
||||
@override
|
||||
String get photoPreviewCaptionHint => 'Add a caption…';
|
||||
|
||||
@override
|
||||
String get photoPreviewDraw => 'Draw';
|
||||
|
||||
@override
|
||||
String get photoPreviewAddText => 'Add text';
|
||||
|
||||
@override
|
||||
String get photoPreviewRotate => 'Rotate';
|
||||
|
||||
@override
|
||||
String get photoPreviewUndo => 'Undo';
|
||||
|
||||
@override
|
||||
String get photoPreviewSend => 'Send';
|
||||
|
||||
@override
|
||||
String get photoPreviewTextDialogTitle => 'Text on photo';
|
||||
|
||||
@override
|
||||
String get photoPreviewRemoveText => 'Remove';
|
||||
|
||||
@override
|
||||
String get photoPreviewDecodeFailed => 'Couldn\'t load the photo';
|
||||
}
|
||||
|
||||
@@ -1257,4 +1257,31 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get commonE2eBadgeFull => 'Cifrato end-to-end';
|
||||
|
||||
@override
|
||||
String get photoPreviewCaptionHint => 'Aggiungi una didascalia…';
|
||||
|
||||
@override
|
||||
String get photoPreviewDraw => 'Disegna';
|
||||
|
||||
@override
|
||||
String get photoPreviewAddText => 'Aggiungi testo';
|
||||
|
||||
@override
|
||||
String get photoPreviewRotate => 'Ruota';
|
||||
|
||||
@override
|
||||
String get photoPreviewUndo => 'Annulla';
|
||||
|
||||
@override
|
||||
String get photoPreviewSend => 'Invia';
|
||||
|
||||
@override
|
||||
String get photoPreviewTextDialogTitle => 'Testo sulla foto';
|
||||
|
||||
@override
|
||||
String get photoPreviewRemoveText => 'Rimuovi';
|
||||
|
||||
@override
|
||||
String get photoPreviewDecodeFailed => 'Impossibile caricare la foto';
|
||||
}
|
||||
|
||||
@@ -1282,4 +1282,31 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get commonE2eBadgeFull => 'Сквозное шифрование';
|
||||
|
||||
@override
|
||||
String get photoPreviewCaptionHint => 'Добавить подпись…';
|
||||
|
||||
@override
|
||||
String get photoPreviewDraw => 'Рисовать';
|
||||
|
||||
@override
|
||||
String get photoPreviewAddText => 'Добавить текст';
|
||||
|
||||
@override
|
||||
String get photoPreviewRotate => 'Повернуть';
|
||||
|
||||
@override
|
||||
String get photoPreviewUndo => 'Отменить';
|
||||
|
||||
@override
|
||||
String get photoPreviewSend => 'Отправить';
|
||||
|
||||
@override
|
||||
String get photoPreviewTextDialogTitle => 'Текст на фото';
|
||||
|
||||
@override
|
||||
String get photoPreviewRemoveText => 'Удалить';
|
||||
|
||||
@override
|
||||
String get photoPreviewDecodeFailed => 'Не удалось загрузить фото';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user