Merge upstream/dev (10 commits) [upstream-sync]

This commit is contained in:
upstream-sync-bot committed 2026-11-16 04:52:13 +00:00
commit 5a53e45e9a
68 files changed
+6375 -178

No files matched your search

+253 -2
View File
@@ -12,6 +12,7 @@ import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_
import '../utils/advert_signature.dart';
import '../models/channel.dart';
import '../models/channel_message.dart';
import '../models/bookmarked_message.dart';
import '../models/companion_radio_stats.dart';
import '../models/contact.dart';
import '../models/message_filter.dart';
@@ -29,11 +30,14 @@ import '../services/linux_ble_pairing_service_stub.dart'
if (dart.library.io) '../services/linux_ble_pairing_service.dart';
import '../services/image_chunk_transport.dart'
show
ImageChunkHeader,
ImageChunkOutcome,
ImageChunkTransport,
buildSendChannelDataFrame,
dataTypeAeicImage,
kImageReassemblyTtl,
outPathUnknown,
parseImageChunkHeader,
respCodeChannelDataRecv,
senderPrefixFromKey;
import '../services/image_codec_service.dart';
@@ -50,6 +54,7 @@ import '../services/notification_reply.dart';
import '../services/notification_service.dart';
import 'meshcore_connector_usb.dart';
import 'meshcore_connector_tcp.dart';
import '../storage/bookmark_store.dart';
import '../storage/channel_message_store.dart';
import '../storage/channel_order_store.dart';
import '../storage/channel_settings_store.dart';
@@ -514,6 +519,7 @@ class MeshCoreConnector extends ChangeNotifier {
// batched here; see [CoalescedWrites].
final CoalescedWrites _coalescedWrites = CoalescedWrites();
final MessageStore _messageStore = MessageStore();
final BookmarkStore _bookmarkStore = BookmarkStore();
final ChannelOrderStore _channelOrderStore = ChannelOrderStore();
final ChannelSettingsStore _channelSettingsStore = ChannelSettingsStore();
final ChannelRegionStore _channelRegionStore = ChannelRegionStore();
@@ -961,6 +967,66 @@ class MeshCoreConnector extends ChangeNotifier {
return _conversations[contact.publicKeyHex] ?? [];
}
Future<List<BookmarkedMessage>> loadBookmarkedMessages() =>
_bookmarkStore.loadBookmarks();
Future<void> setBookmarkedMessage(
BookmarkedMessage bookmark, {
required bool isBookmarked,
}) async {
if (_bookmarkStore.publicKeyHex.isEmpty) return;
if (isBookmarked) {
await _bookmarkStore.saveBookmark(bookmark);
} else {
await _bookmarkStore.removeBookmark(bookmark);
}
if (bookmark.sourceType == BookmarkSourceType.contact) {
final messages = _conversations[bookmark.sourceId];
final index = messages?.indexWhere(
(message) => message.messageId == bookmark.messageId,
);
if (messages != null && index != null && index >= 0) {
messages[index] = messages[index].copyWith(isBookmarked: isBookmarked);
await _coalescedWrites.flush();
await _messageStore.saveMessages(bookmark.sourceId, messages);
}
await _messageStore.updateBookmarkFlag(
bookmark.sourceId,
bookmark.messageId,
isBookmarked,
);
} else {
final mappedSlot = _slotForChannelId(bookmark.sourceId);
final slot =
mappedSlot ??
(bookmark.sourceId.startsWith('slot:')
? int.tryParse(bookmark.sourceId.substring(5))
: null);
if (slot != null) {
final canonicalSlot = _canonicalSlot(slot);
final messages = _channelMessages[canonicalSlot];
final index = messages?.indexWhere(
(message) => message.messageId == bookmark.messageId,
);
if (messages != null && index != null && index >= 0) {
messages[index] = messages[index].copyWith(
isBookmarked: isBookmarked,
);
await _saveChannelMessages(canonicalSlot, messages);
}
}
if (!bookmark.sourceId.startsWith('slot:')) {
await _channelMessageStore.updateBookmarkFlag(
bookmark.sourceId,
bookmark.messageId,
isBookmarked,
);
}
}
notifyListeners();
}
Future<void> deleteMessage(Message message) async {
final contactKeyHex = message.senderKeyHex;
final messages = _conversations[contactKeyHex];
@@ -2133,6 +2199,8 @@ class MeshCoreConnector extends ChangeNotifier {
notifyListeners();
}
Future<void> reloadChannelOrder() => _loadChannelOrder();
/// History is stored by channel ID, so it may carry the slot the channel
/// sat in when it was saved; rebind it to the slot it is shown in now.
List<ChannelMessage> _bindToSlot(List<ChannelMessage> messages, int slot) => [
@@ -5714,7 +5782,9 @@ class MeshCoreConnector extends ChangeNotifier {
/// queued a packet to the radio. It says nothing about transmission or
/// delivery — GRP_DATA is unacknowledged flood traffic, there is no
/// PUSH_CODE_SEND_CONFIRMED for it, and a chunk may still be lost on air.
/// That is what the XOR parity chunk is for.
/// That is what the XOR parity chunk is for, and why repeater echoes are
/// counted afterwards ([ownImageEchoes]). With [repairUnheardChunks], chunks
/// no repeater echoed are resent once (see [_repairUnheardImageChunks]).
///
/// Returns false when the transport is unavailable (disconnected or firmware
/// too old); throws whatever [_sendFrameAndWaitForCommandAck] throws, i.e.
@@ -5727,9 +5797,47 @@ class MeshCoreConnector extends ChangeNotifier {
required int channelIndex,
required Duration interChunkDelay,
void Function(int sent, int total)? onProgress,
bool repairUnheardChunks = true,
}) async {
if (blobs.isEmpty) return false;
if (!supportsChannelData) return false;
final header = parseImageChunkHeader(blobs.first);
final key = header == null ? null : (channelIndex, header.imgId);
if (key != null && repairUnheardChunks) {
// Index == chunk index: data chunks first, the parity chunk (index ==
// total) last, so blobs.length slots cover every chunk we send.
_ownImageEchoes.remove(key);
_ownImageEchoes[key] = List<int>.filled(blobs.length, 0);
while (_ownImageEchoes.length > _maxTrackedOwnImages) {
_ownImageEchoes.remove(_ownImageEchoes.keys.first);
}
}
final startedAt = DateTime.now();
final sentAll = await _transmitImageBlobs(
blobs,
channelIndex: channelIndex,
interChunkDelay: interChunkDelay,
onProgress: onProgress,
);
if (sentAll && key != null && repairUnheardChunks) {
unawaited(
_repairUnheardImageChunks(
key,
blobs,
interChunkDelay: interChunkDelay,
startedAt: startedAt,
),
);
}
return sentAll;
}
Future<bool> _transmitImageBlobs(
List<Uint8List> blobs, {
required int channelIndex,
required Duration interChunkDelay,
void Function(int sent, int total)? onProgress,
}) async {
// `return` inside the scoped callback only exits the callback, so a
// disconnect mid-send used to fall through to `return true` below and the
// caller would record a complete outgoing image and tell the user "sent"
@@ -5760,6 +5868,142 @@ class MeshCoreConnector extends ChangeNotifier {
return sentAll;
}
// ---- repeater echoes of our own image chunks -------------------------------
//
// GRP_DATA is never acknowledged. What we can observe is a repeater
// re-flooding one of our chunks: the radio reports it in the raw RX log, the
// same way repeats of channel text are counted. A chunk nobody echoed while
// other chunks of the same image were echoed was most likely lost, so it is
// sent once more.
/// How long to listen for echoes after the last chunk before repairing.
static const Duration _imageEchoWait = Duration(seconds: 15);
/// Receivers drop a partial image [kImageReassemblyTtl] after its first
/// chunk. A repair that cannot land well inside that window is skipped.
static const Duration _imageRepairDeadline = Duration(seconds: 45);
static const int _maxTrackedOwnImages = 16;
final Map<(int, int), List<int>> _ownImageEchoes = {};
final Set<(int, int)> _imageRepairsInFlight = {};
/// Repeater echoes heard for each chunk of one of our own images sent this
/// session (data chunks, then the parity chunk), or null if not tracked.
List<int>? ownImageEchoes(int channelIndex, int imgId) {
final echoes = _ownImageEchoes[(channelIndex, imgId)];
return echoes == null ? null : List<int>.unmodifiable(echoes);
}
/// Non-null while unheard chunks of that image are being resent.
({int resends, int maxResends})? imageResendProgress(
int channelIndex,
int imgId,
) => _imageRepairsInFlight.contains((channelIndex, imgId))
? (resends: 1, maxResends: 1)
: null;
/// A GRP_DATA packet from the raw RX log. Other people's images arrive
/// already decrypted through RESP_CODE_CHANNEL_DATA_RECV; here we only look
/// for repeaters re-flooding one of our own chunks.
void _handleImageEcho(_RawPacket packet) {
final self = senderPrefixFromKey(_selfPublicKey);
if (self == null || packet.payload.length < 2) return;
final channelHash = packet.payload[0];
final encrypted = Uint8List.fromList(packet.payload.sublist(1));
final channels = _channels.isNotEmpty ? _channels : _cachedChannels;
for (final channel in channels) {
if (channel.isEmpty) continue;
if (_computeChannelHash(channel.psk) != channelHash) continue;
// Null unless the MAC matches this channel's key.
final plain = _decryptPayload(channel.psk, encrypted);
if (plain == null || plain.length < 3) continue;
// Plaintext: data_type (uint16 LE), data_len, blob (padded to 16).
final dataType = plain[0] | (plain[1] << 8);
final length = plain[2];
if (dataType != dataTypeAeicImage || plain.length < 3 + length) return;
final header = parseImageChunkHeader(
Uint8List.sublistView(plain, 3, 3 + length),
);
if (header == null || header.senderPrefix != self) return;
final channelId = channel.storageId;
final slot = _channelMapConfirmed && channelId != null
? _slotForChannelId(channelId)
: channel.index;
if (slot == null) return;
_recordOwnImageEcho(slot, header);
return;
}
}
void _recordOwnImageEcho(int slot, ImageChunkHeader header) {
final echoes = _ownImageEchoes[(slot, header.imgId)];
if (echoes == null || header.index >= echoes.length) return;
echoes[header.index]++;
unawaited(
_receivedImageStore?.setOutgoingEchoes(
channelIndex: slot,
senderPrefix: header.senderPrefix,
imgId: header.imgId,
echoes: List<int>.of(echoes),
),
);
notifyListeners();
}
/// One repair round: resend the chunks no repeater was heard echoing, but
/// only when some other chunk of the image was echoed. With no echo at all
/// we cannot tell a lost image from a sender with no repeater in earshot,
/// and resending would double every such user's airtime for nothing.
///
/// The resent chunk is byte-identical, so a repeater that did forward it
/// (and we just missed the echo) drops the copy as already seen. Receivers
/// missing it merge it into the image they are still holding.
Future<void> _repairUnheardImageChunks(
(int, int) key,
List<Uint8List> blobs, {
required Duration interChunkDelay,
required DateTime startedAt,
}) async {
await Future<void>.delayed(_imageEchoWait);
final echoes = _ownImageEchoes[key];
if (echoes == null || echoes.length != blobs.length || !isConnected) {
return;
}
final unheard = <Uint8List>[
for (var i = 0; i < blobs.length; i++)
if (echoes[i] == 0) blobs[i],
];
if (unheard.isEmpty || unheard.length == blobs.length) return;
if (DateTime.now().difference(startedAt) > _imageRepairDeadline) {
_appDebugLogService?.info(
'Image ${key.$2}: ${unheard.length} chunk(s) unheard, too late to '
'resend before receivers give up',
tag: 'Image resend',
);
return;
}
_appDebugLogService?.info(
'Image ${key.$2}: resending ${unheard.length} of ${blobs.length} '
'chunk(s) no repeater echoed',
tag: 'Image resend',
);
_imageRepairsInFlight.add(key);
notifyListeners();
try {
await _transmitImageBlobs(
unheard,
channelIndex: key.$1,
interChunkDelay: interChunkDelay,
);
} catch (e) {
_appDebugLogService?.warn('Image resend failed: $e', tag: 'Image resend');
} finally {
_imageRepairsInFlight.remove(key);
notifyListeners();
}
}
Future<void> _runScopedChannelSend(
Future<void> Function() action, {
required String region,
@@ -8396,7 +8640,12 @@ class MeshCoreConnector extends ChangeNotifier {
final raw = reader.readRemainingBytes();
final packet = _parseRawPacket(raw);
if (packet == null || packet.payloadType != _payloadTypeGroupText) return;
if (packet == null) return;
if (packet.payloadType == _payloadTypeGroupData) {
_handleImageEcho(packet);
return;
}
if (packet.payloadType != _payloadTypeGroupText) return;
final payload = BufferReader(packet.payload);
final channelHash = payload.readByte();
@@ -9609,6 +9858,7 @@ class MeshCoreConnector extends ChangeNotifier {
unawaited(_unreadStore.flush());
_channelMessageStore.setPublicKeyHex = keyHex;
_messageStore.setPublicKeyHex = keyHex;
_bookmarkStore.setPublicKeyHex = keyHex;
_channelOrderStore.setPublicKeyHex = keyHex;
_channelSettingsStore.setPublicKeyHex = keyHex;
_channelRegionStore.setPublicKeyHex = keyHex;
@@ -10477,6 +10727,7 @@ const int _routeFlood = 0x01;
const int _routeTransportDirect = 0x03;
const int _payloadTypeGroupText = 0x05;
const int _payloadTypeGroupData = 0x06;
const int _cipherMacSize = 2;
bool _isPathLenValidForMode(
+2 -1
View File
@@ -66,8 +66,9 @@ class MessageUrlImageHelper {
static Future<String?> parse(
String text, {
String publicGateway = AppSettings.defaultPublicIpfsGateway,
bool respectLoadSetting = true,
}) async {
if (!loadLinkImages.value) return null;
if (respectLoadSetting && !loadLinkImages.value) return null;
final trimmed = text.trim();
if (trimmed.isEmpty) return null;
+51
View File
@@ -229,6 +229,7 @@
"backupRestore_contactsDescription": "Contacts, per-contact filters and settings, groups, and message history",
"backupRestore_discoveredContacts": "Discovered Contacts",
"backupRestore_discoveredContactsDescription": "Discovered contacts and their saved details",
"backupRestore_bookmarks": "Bookmarks",
"backupRestore_channels": "Channels",
"backupRestore_channelsDescription": "Channels, channel filters, communities, and message history",
"backupRestore_backup": "Create Backup",
@@ -1128,6 +1129,14 @@
},
"chat_messageCopied": "Message copied",
"chat_messageDeleted": "Message deleted",
"chat_bookmark": "Bookmark",
"chat_removeBookmark": "Remove bookmark",
"chat_showBookmarks": "Show bookmarks",
"bookmarks_title": "Bookmarks",
"bookmarks_empty": "No bookmarked messages",
"bookmarks_channel": "Channel",
"bookmarks_contact": "Contact",
"bookmarks_remove": "Remove bookmark",
"chat_selectMessages": "Select messages",
"chat_selectedCount": "{count} selected",
"@chat_selectedCount": {
@@ -3141,6 +3150,10 @@
"notification_replyUnavailable": "This conversation is no longer on the connected radio.",
"notification_replySendFailed": "Your reply may not have been sent. Check in MeshCore Open and try again.",
"notification_replyAppNotRunning": "MeshCore Open isn't running. Open it and send your reply again.",
"settings_exportBookmarks": "Export bookmarks to Markdown",
"settings_exportBookmarksSubtitle": "Share or save bookmarked messages as a Markdown file.",
"settings_exportBookmarksSuccess": "Bookmarks exported.",
"settings_exportBookmarksNoBookmarks": "No bookmarks to export.",
"settings_gpxExportRepeaters": "Export repeaters / room server to GPX",
"settings_gpxExportRepeatersSubtitle": "Exports repeaters / roomserver with a location to GPX file.",
"settings_gpxExportContacts": "Export companions to GPX",
@@ -3496,6 +3509,44 @@
"imageSend_viewOriginal": "Original",
"imageSend_viewReconstruction": "What recipients see",
"imageSend_reconstructionUnavailable": "This device can't preview the reconstruction.",
"receivedImage_packetEchoes": "Packet {number}: {count, plural, =0{no repeater heard} =1{repeated once} other{repeated {count} times}}",
"@receivedImage_packetEchoes": {
"placeholders": {
"number": {
"type": "int"
},
"count": {
"type": "int"
}
}
},
"receivedImage_recoveryPacketEchoes": "Recovery packet: {count, plural, =0{no repeater heard} =1{repeated once} other{repeated {count} times}}",
"@receivedImage_recoveryPacketEchoes": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"imageSend_preparingPreview": "Preparing preview…",
"imageSend_tryAnother": "Try another version",
"imageSend_versionsHint": "Each version is reconstructed a little differently. Pick the one that looks most like your photo.",
"imageSend_versionLabel": "Version {number}",
"@imageSend_versionLabel": {
"placeholders": {
"number": {
"type": "int"
}
}
},
"imageSend_versionPackets": "{count, plural, =1{1 packet} other{{count} packets}}",
"@imageSend_versionPackets": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"imageSend_modelNotDownloaded": "The image model isn't downloaded yet. Download it in Settings to send images.",
"imageSend_originalSize": "Original",
"imageSend_onAirSize": "On air",
+120
View File
@@ -1051,6 +1051,12 @@ abstract class AppLocalizations {
/// **'Discovered contacts and their saved details'**
String get backupRestore_discoveredContactsDescription;
/// No description provided for @backupRestore_bookmarks.
///
/// In en, this message translates to:
/// **'Bookmarks'**
String get backupRestore_bookmarks;
/// No description provided for @backupRestore_channels.
///
/// In en, this message translates to:
@@ -4039,6 +4045,54 @@ abstract class AppLocalizations {
/// **'Message deleted'**
String get chat_messageDeleted;
/// No description provided for @chat_bookmark.
///
/// In en, this message translates to:
/// **'Bookmark'**
String get chat_bookmark;
/// No description provided for @chat_removeBookmark.
///
/// In en, this message translates to:
/// **'Remove bookmark'**
String get chat_removeBookmark;
/// No description provided for @chat_showBookmarks.
///
/// In en, this message translates to:
/// **'Show bookmarks'**
String get chat_showBookmarks;
/// No description provided for @bookmarks_title.
///
/// In en, this message translates to:
/// **'Bookmarks'**
String get bookmarks_title;
/// No description provided for @bookmarks_empty.
///
/// In en, this message translates to:
/// **'No bookmarked messages'**
String get bookmarks_empty;
/// No description provided for @bookmarks_channel.
///
/// In en, this message translates to:
/// **'Channel'**
String get bookmarks_channel;
/// No description provided for @bookmarks_contact.
///
/// In en, this message translates to:
/// **'Contact'**
String get bookmarks_contact;
/// No description provided for @bookmarks_remove.
///
/// In en, this message translates to:
/// **'Remove bookmark'**
String get bookmarks_remove;
/// No description provided for @chat_selectMessages.
///
/// In en, this message translates to:
@@ -9497,6 +9551,30 @@ abstract class AppLocalizations {
/// **'MeshCore Open isn\'t running. Open it and send your reply again.'**
String get notification_replyAppNotRunning;
/// No description provided for @settings_exportBookmarks.
///
/// In en, this message translates to:
/// **'Export bookmarks to Markdown'**
String get settings_exportBookmarks;
/// No description provided for @settings_exportBookmarksSubtitle.
///
/// In en, this message translates to:
/// **'Share or save bookmarked messages as a Markdown file.'**
String get settings_exportBookmarksSubtitle;
/// No description provided for @settings_exportBookmarksSuccess.
///
/// In en, this message translates to:
/// **'Bookmarks exported.'**
String get settings_exportBookmarksSuccess;
/// No description provided for @settings_exportBookmarksNoBookmarks.
///
/// In en, this message translates to:
/// **'No bookmarks to export.'**
String get settings_exportBookmarksNoBookmarks;
/// No description provided for @settings_gpxExportRepeaters.
///
/// In en, this message translates to:
@@ -10565,6 +10643,48 @@ abstract class AppLocalizations {
/// **'This device can\'t preview the reconstruction.'**
String get imageSend_reconstructionUnavailable;
/// No description provided for @receivedImage_packetEchoes.
///
/// In en, this message translates to:
/// **'Packet {number}: {count, plural, =0{no repeater heard} =1{repeated once} other{repeated {count} times}}'**
String receivedImage_packetEchoes(int number, int count);
/// No description provided for @receivedImage_recoveryPacketEchoes.
///
/// In en, this message translates to:
/// **'Recovery packet: {count, plural, =0{no repeater heard} =1{repeated once} other{repeated {count} times}}'**
String receivedImage_recoveryPacketEchoes(int count);
/// No description provided for @imageSend_preparingPreview.
///
/// In en, this message translates to:
/// **'Preparing preview…'**
String get imageSend_preparingPreview;
/// No description provided for @imageSend_tryAnother.
///
/// In en, this message translates to:
/// **'Try another version'**
String get imageSend_tryAnother;
/// No description provided for @imageSend_versionsHint.
///
/// In en, this message translates to:
/// **'Each version is reconstructed a little differently. Pick the one that looks most like your photo.'**
String get imageSend_versionsHint;
/// No description provided for @imageSend_versionLabel.
///
/// In en, this message translates to:
/// **'Version {number}'**
String imageSend_versionLabel(int number);
/// No description provided for @imageSend_versionPackets.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 packet} other{{count} packets}}'**
String imageSend_versionPackets(int count);
/// No description provided for @imageSend_modelNotDownloaded.
///
/// In en, this message translates to:
+90
View File
@@ -529,6 +529,9 @@ class AppLocalizationsBg extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Открити контакти и запазените им данни';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Канали';
@@ -2280,6 +2283,30 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get chat_messageDeleted => 'Съобщението е изтрито';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Избор на съобщения';
@@ -5590,6 +5617,19 @@ class AppLocalizationsBg extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open не работи. Отворете го и изпратете отговора си повторно.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Експортиране на повтарящи се устройства / сървър на стаята до GPX';
@@ -6245,6 +6285,56 @@ class AppLocalizationsBg extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Това устройство не може да покаже реконструкцията.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Моделът за изображения още не е изтеглен. Изтеглете го в настройките, за да изпращате изображения.';
+90
View File
@@ -524,6 +524,9 @@ class AppLocalizationsCs extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Objevené kontakty a jejich uložené údaje';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanály';
@@ -2264,6 +2267,30 @@ class AppLocalizationsCs extends AppLocalizations {
@override
String get chat_messageDeleted => 'Zpráva smazána';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Vybrat zprávy';
@@ -5569,6 +5596,19 @@ class AppLocalizationsCs extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open neběží. Otevřete ji a odešlete odpověď znovu.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exportovat opakovače / room servery do GPX';
@@ -6231,6 +6271,56 @@ class AppLocalizationsCs extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Toto zařízení nemůže zobrazit náhled rekonstrukce.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Model obrázků ještě není stažen. Pro odesílání obrázků jej stáhněte v Nastavení.';
+90
View File
@@ -531,6 +531,9 @@ class AppLocalizationsDe extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Entdeckte Kontakte und ihre gespeicherten Details';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanäle';
@@ -2284,6 +2287,30 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get chat_messageDeleted => 'Nachricht gelöscht';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Nachrichten auswählen';
@@ -5604,6 +5631,19 @@ class AppLocalizationsDe extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open wird nicht ausgeführt. Öffnen Sie die App und senden Sie Ihre Antwort erneut.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Repeater und Raumserver als GPX exportieren';
@@ -6263,6 +6303,56 @@ class AppLocalizationsDe extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Dieses Gerät kann die Rekonstruktion nicht in der Vorschau anzeigen.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Das Bildmodell wurde noch nicht heruntergeladen. Laden Sie es in den Einstellungen herunter, um Bilder zu senden.';
+90
View File
@@ -520,6 +520,9 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Discovered contacts and their saved details';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Channels';
@@ -2239,6 +2242,30 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get chat_messageDeleted => 'Message deleted';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Select messages';
@@ -5515,6 +5542,19 @@ class AppLocalizationsEn extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open isn\'t running. Open it and send your reply again.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Export repeaters / room server to GPX';
@@ -6159,6 +6199,56 @@ class AppLocalizationsEn extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'This device can\'t preview the reconstruction.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'The image model isn\'t downloaded yet. Download it in Settings to send images.';
+90
View File
@@ -529,6 +529,9 @@ class AppLocalizationsEs extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Contactos descubiertos y sus detalles guardados';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Canales';
@@ -2274,6 +2277,30 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get chat_messageDeleted => 'Mensaje borrado';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Seleccionar mensajes';
@@ -5588,6 +5615,19 @@ class AppLocalizationsEs extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open no está en ejecución. Ábrelo y envía tu respuesta de nuevo.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exportar repetidores / servidores de sala a GPX';
@@ -6247,6 +6287,56 @@ class AppLocalizationsEs extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Este dispositivo no puede previsualizar la reconstrucción.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'El modelo de imagen aún no se ha descargado. Descárgalo en Configuración para enviar imágenes.';
+90
View File
@@ -529,6 +529,9 @@ class AppLocalizationsFr extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Contacts découverts et leurs détails enregistrés';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Canaux';
@@ -2279,6 +2282,30 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get chat_messageDeleted => 'Message supprimé';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Sélectionner des messages';
@@ -5606,6 +5633,19 @@ class AppLocalizationsFr extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open n\'est pas actif. Ouvrez l\'application et renvoyez votre réponse.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exporter les répéteurs / room servers au format GPX';
@@ -6270,6 +6310,56 @@ class AppLocalizationsFr extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Cet appareil ne peut pas prévisualiser la reconstitution.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Le modèle d\'image n\'est pas encore téléchargé. Téléchargez-le dans Paramètres pour envoyer des images.';
+90
View File
@@ -524,6 +524,9 @@ class AppLocalizationsHu extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Felfedezett névjegyek és mentett adataik';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Csatornák';
@@ -2272,6 +2275,30 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get chat_messageDeleted => 'Üzenet törölve';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Üzenetek kijelölése';
@@ -5591,6 +5618,19 @@ class AppLocalizationsHu extends AppLocalizations {
String get notification_replyAppNotRunning =>
'A MeshCore Open nem fut. Nyissa meg, és küldje el a választ újra.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Ismétlők / szobaszerver exportálása GPX-be';
@@ -6244,6 +6284,56 @@ class AppLocalizationsHu extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Ezen az eszközön nem jeleníthető meg a rekonstrukció előnézete.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'A képmodell még nincs letöltve. Töltse le a Beállításokban a képek küldéséhez.';
+90
View File
@@ -529,6 +529,9 @@ class AppLocalizationsIt extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Contatti scoperti e relativi dettagli salvati';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Canali';
@@ -2276,6 +2279,30 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get chat_messageDeleted => 'Messaggio eliminato';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Seleziona messaggi';
@@ -5593,6 +5620,19 @@ class AppLocalizationsIt extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open non è in esecuzione. Aprila e invia di nuovo la risposta.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Esporta ripetitori / server di stanza in GPX';
@@ -6252,6 +6292,56 @@ class AppLocalizationsIt extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Questo dispositivo non può mostrare un\'anteprima della ricostruzione.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Il modello di immagine non è ancora stato scaricato. Scaricalo nelle Impostazioni per inviare immagini.';
+90
View File
@@ -504,6 +504,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get backupRestore_discoveredContactsDescription => '検出された連絡先と保存済みの詳細';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'チャンネル';
@@ -2166,6 +2169,30 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get chat_messageDeleted => 'メッセージは削除されました';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'メッセージを選択';
@@ -5322,6 +5349,19 @@ class AppLocalizationsJa extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open が起動していません。起動してから、もう一度返信を送信してください。';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters => 'GPX へのエクスポート用リピータ/ルームサーバー';
@@ -5944,6 +5984,56 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get imageSend_reconstructionUnavailable => 'このデバイスでは復元結果をプレビューできません。';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'画像モデルがまだダウンロードされていません。設定でダウンロードすると画像を送信できます。';
+90
View File
@@ -505,6 +505,9 @@ class AppLocalizationsKo extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'발견된 연락처와 저장된 세부 정보';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => '채널';
@@ -2170,6 +2173,30 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get chat_messageDeleted => '메시지가 삭제되었습니다.';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => '메시지 선택';
@@ -5338,6 +5365,19 @@ class AppLocalizationsKo extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open이 실행 중이 아닙니다. 앱을 연 뒤 답장을 다시 보내세요.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters => 'GPX로 전송/방 관리 서버';
@@ -5960,6 +6000,56 @@ class AppLocalizationsKo extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'이 장치에서는 복원 결과를 미리 볼 수 없습니다.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'이미지 모델이 아직 다운로드되지 않았습니다. 설정에서 다운로드하면 이미지를 보낼 수 있습니다.';
+90
View File
@@ -525,6 +525,9 @@ class AppLocalizationsNl extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Ontdekte contacten en hun opgeslagen gegevens';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanalen';
@@ -2263,6 +2266,30 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get chat_messageDeleted => 'Bericht verwijderd';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Berichten selecteren';
@@ -5565,6 +5592,19 @@ class AppLocalizationsNl extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open is niet actief. Open de app en verzend je antwoord opnieuw.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exporteer repeaters / roomserver naar GPX';
@@ -6216,6 +6256,56 @@ class AppLocalizationsNl extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Dit apparaat kan geen voorbeeld van de reconstructie tonen.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Het afbeeldingsmodel is nog niet gedownload. Download het in Instellingen om afbeeldingen te verzenden.';
+90
View File
@@ -532,6 +532,9 @@ class AppLocalizationsPl extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Wykryte kontakty i ich zapisane dane';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanały';
@@ -2292,6 +2295,30 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get chat_messageDeleted => 'Wiadomość usunięta';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Wybierz wiadomości';
@@ -5629,6 +5656,19 @@ class AppLocalizationsPl extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open nie jest uruchomiony. Otwórz go i wyślij odpowiedź jeszcze raz.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Eksportuj przekaźniki / roomservery do GPX';
@@ -6290,6 +6330,56 @@ class AppLocalizationsPl extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'To urządzenie nie może wyświetlić podglądu rekonstrukcji.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Model obrazowy nie jest jeszcze pobrany. Pobierz go w Ustawieniach, aby wysyłać obrazy.';
+90
View File
@@ -530,6 +530,9 @@ class AppLocalizationsPt extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Contatos descobertos e seus detalhes salvos';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Canais';
@@ -2273,6 +2276,30 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get chat_messageDeleted => 'Mensagem excluída';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Selecionar mensagens';
@@ -5587,6 +5614,19 @@ class AppLocalizationsPt extends AppLocalizations {
String get notification_replyAppNotRunning =>
'O MeshCore Open não está em execução. Abra-o e envie a sua resposta novamente.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exportar repetidores / servidor de sala para GPX';
@@ -6241,6 +6281,56 @@ class AppLocalizationsPt extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Este dispositivo não pode pré-visualizar a reconstrução.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'O modelo de imagem ainda não foi transferido. Transfira-o nas Configurações para enviar imagens.';
+90
View File
@@ -527,6 +527,9 @@ class AppLocalizationsRu extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Обнаруженные контакты и их сохранённые данные';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Каналы';
@@ -2273,6 +2276,30 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get chat_messageDeleted => 'Сообщение удалено';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Выбрать сообщения';
@@ -5606,6 +5633,19 @@ class AppLocalizationsRu extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open не запущен. Откройте его и отправьте ответ снова.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Экспортировать рипитеры / сервер комнаты в GPX';
@@ -6266,6 +6306,56 @@ class AppLocalizationsRu extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Это устройство не может показать реконструкцию.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Модель изображения ещё не загружена. Загрузите её в настройках, чтобы отправлять изображения.';
+90
View File
@@ -528,6 +528,9 @@ class AppLocalizationsSk extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Objavené kontakty a ich uložené údaje';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanály';
@@ -2266,6 +2269,30 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get chat_messageDeleted => 'Správa odstránená';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Vybrať správy';
@@ -5585,6 +5612,19 @@ class AppLocalizationsSk extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open nebeží. Otvorte ho a odošlite odpoveď ešte raz.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exportovať repeater / server miestnosti do GPX';
@@ -6240,6 +6280,56 @@ class AppLocalizationsSk extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Toto zariadenie nedokáže zobraziť náhľad rekonštrukcie.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Model obrazu ešte nie je stiahnutý. Stiahnite ho v Nastaveniach, aby ste mohli posielať obrázky.';
+90
View File
@@ -526,6 +526,9 @@ class AppLocalizationsSl extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Odkriti kontakti in njihovi shranjeni podatki';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanali';
@@ -2266,6 +2269,30 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get chat_messageDeleted => 'Sporočilo izbrisano';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Izberi sporočila';
@@ -5575,6 +5602,19 @@ class AppLocalizationsSl extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open ne teče. Odprite ga in ponovno pošite odgovor.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Izvoz ponoviteljev / strežnika sobe v GPX';
@@ -6232,6 +6272,56 @@ class AppLocalizationsSl extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Ta naprava ne more prikazati predogleda rekonstrukcije.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Obrazni model še ni prenesen. Prenesite ga v Nastavitvah, da boste lahko pošiljali slike.';
+90
View File
@@ -526,6 +526,9 @@ class AppLocalizationsSv extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Upptäckta kontakter och deras sparade uppgifter';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Kanaler';
@@ -2252,6 +2255,30 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get chat_messageDeleted => 'Meddelandet raderat';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Markera meddelanden';
@@ -5545,6 +5572,19 @@ class AppLocalizationsSv extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open är inte igång. Öppna appen och skicka ditt svar igen.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Exportera repeatrar/rumsservrar till GPX';
@@ -6199,6 +6239,56 @@ class AppLocalizationsSv extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Enheten kan inte förhandsgranska rekonstruktionen.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Bildmodellen har ännu inte laddats ner. Ladda ner den i Inställningar för att skicka bilder.';
+90
View File
@@ -526,6 +526,9 @@ class AppLocalizationsUk extends AppLocalizations {
String get backupRestore_discoveredContactsDescription =>
'Виявлені контакти та їхні збережені дані';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => 'Канали';
@@ -2269,6 +2272,30 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get chat_messageDeleted => 'Повідомлення видалено';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => 'Вибрати повідомлення';
@@ -5610,6 +5637,19 @@ class AppLocalizationsUk extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open не запущено. Відкрийте його та надішліть відповідь ще раз.';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters =>
'Експорт ретрансляторів і серверів кімнат у GPX';
@@ -6272,6 +6312,56 @@ class AppLocalizationsUk extends AppLocalizations {
String get imageSend_reconstructionUnavailable =>
'Цей пристрій не може показати відтворення.';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded =>
'Модель зображення ще не завантажена. Завантажте її в налаштуваннях, щоб надсилати зображення.';
+90
View File
@@ -495,6 +495,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get backupRestore_discoveredContactsDescription => '已发现的联系人及其保存的详细信息';
@override
String get backupRestore_bookmarks => 'Bookmarks';
@override
String get backupRestore_channels => '频道';
@@ -2138,6 +2141,30 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get chat_messageDeleted => '消息已删除';
@override
String get chat_bookmark => 'Bookmark';
@override
String get chat_removeBookmark => 'Remove bookmark';
@override
String get chat_showBookmarks => 'Show bookmarks';
@override
String get bookmarks_title => 'Bookmarks';
@override
String get bookmarks_empty => 'No bookmarked messages';
@override
String get bookmarks_channel => 'Channel';
@override
String get bookmarks_contact => 'Contact';
@override
String get bookmarks_remove => 'Remove bookmark';
@override
String get chat_selectMessages => '选择消息';
@@ -5199,6 +5226,19 @@ class AppLocalizationsZh extends AppLocalizations {
String get notification_replyAppNotRunning =>
'MeshCore Open 未在运行。请打开它并再次发送回复。';
@override
String get settings_exportBookmarks => 'Export bookmarks to Markdown';
@override
String get settings_exportBookmarksSubtitle =>
'Share or save bookmarked messages as a Markdown file.';
@override
String get settings_exportBookmarksSuccess => 'Bookmarks exported.';
@override
String get settings_exportBookmarksNoBookmarks => 'No bookmarks to export.';
@override
String get settings_gpxExportRepeaters => '导出转发节点/房间服务器到 GPX';
@@ -5807,6 +5847,56 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get imageSend_reconstructionUnavailable => '此设备无法预览重建结果。';
@override
String receivedImage_packetEchoes(int number, int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Packet $number: $_temp0';
}
@override
String receivedImage_recoveryPacketEchoes(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'repeated $count times',
one: 'repeated once',
zero: 'no repeater heard',
);
return 'Recovery packet: $_temp0';
}
@override
String get imageSend_preparingPreview => 'Preparing preview…';
@override
String get imageSend_tryAnother => 'Try another version';
@override
String get imageSend_versionsHint =>
'Each version is reconstructed a little differently. Pick the one that looks most like your photo.';
@override
String imageSend_versionLabel(int number) {
return 'Version $number';
}
@override
String imageSend_versionPackets(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count packets',
one: '1 packet',
);
return '$_temp0';
}
@override
String get imageSend_modelNotDownloaded => '图像模型尚未下载。在设置中下载后才能发送图像。';
+2
View File
@@ -143,6 +143,8 @@ void main() async {
<Uint8List>[blob],
channelIndex: channelIndex,
interChunkDelay: Duration.zero,
// One blob at a time: echo tracking needs the whole chunk set.
repairUnheardChunks: false,
),
// Overwritten by onImageSenderPrefix as soon as SELF_INFO lands.
senderPrefix: 0,
+110
View File
@@ -0,0 +1,110 @@
import 'package:flutter/foundation.dart';
import 'channel_message.dart';
import 'message.dart';
enum BookmarkSourceType { contact, channel }
@immutable
class BookmarkedMessage {
final BookmarkSourceType sourceType;
final String sourceId;
final String sourceName;
final String messageId;
final String senderName;
final String text;
final String? translatedText;
final DateTime timestamp;
final DateTime receivedAt;
final bool isOutgoing;
const BookmarkedMessage({
required this.sourceType,
required this.sourceId,
required this.sourceName,
required this.messageId,
required this.senderName,
required this.text,
required this.timestamp,
required this.receivedAt,
required this.isOutgoing,
this.translatedText,
});
factory BookmarkedMessage.fromContact({
required Message message,
required String contactKey,
required String contactName,
required String senderName,
}) => BookmarkedMessage(
sourceType: BookmarkSourceType.contact,
sourceId: contactKey,
sourceName: contactName,
messageId: message.messageId,
senderName: senderName,
text: message.text,
translatedText: message.translatedText,
timestamp: message.timestamp,
receivedAt: message.receivedAt,
isOutgoing: message.isOutgoing,
);
factory BookmarkedMessage.fromChannel({
required ChannelMessage message,
required String channelId,
required String channelName,
required String senderName,
}) => BookmarkedMessage(
sourceType: BookmarkSourceType.channel,
sourceId: channelId,
sourceName: channelName,
messageId: message.messageId,
senderName: senderName,
text: message.text,
translatedText: message.translatedText,
timestamp: message.timestamp,
receivedAt: message.receivedAt,
isOutgoing: message.isOutgoing,
);
String get storageId => storageIdFor(sourceType, sourceId, messageId);
static String storageIdFor(
BookmarkSourceType sourceType,
String sourceId,
String messageId,
) => '${sourceType.name}:$sourceId:$messageId';
Map<String, Object?> toJson() => {
'sourceType': sourceType.name,
'sourceId': sourceId,
'sourceName': sourceName,
'messageId': messageId,
'senderName': senderName,
'text': text,
'translatedText': translatedText,
'timestamp': timestamp.millisecondsSinceEpoch,
'receivedAt': receivedAt.millisecondsSinceEpoch,
'isOutgoing': isOutgoing,
};
factory BookmarkedMessage.fromJson(Map<String, dynamic> json) {
final type = BookmarkSourceType.values.firstWhere(
(value) => value.name == json['sourceType'],
);
return BookmarkedMessage(
sourceType: type,
sourceId: json['sourceId'] as String,
sourceName: json['sourceName'] as String,
messageId: json['messageId'] as String,
senderName: json['senderName'] as String,
text: json['text'] as String,
translatedText: json['translatedText'] as String?,
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] as int),
receivedAt: DateTime.fromMillisecondsSinceEpoch(
json['receivedAt'] as int? ?? json['timestamp'] as int,
),
isOutgoing: json['isOutgoing'] as bool? ?? false,
);
}
}
+4
View File
@@ -43,6 +43,7 @@ class ChannelMessage {
/// to the bottom; [timestamp] stays the sender's identity time.
final DateTime receivedAt;
final bool isOutgoing;
final bool isBookmarked;
final ChannelMessageStatus status;
final List<Repeat> repeats;
final int repeatCount;
@@ -77,6 +78,7 @@ class ChannelMessage {
required this.timestamp,
DateTime? receivedAt,
required this.isOutgoing,
this.isBookmarked = false,
this.status = ChannelMessageStatus.pending,
this.repeats = const [],
this.repeatCount = 0,
@@ -117,6 +119,7 @@ class ChannelMessage {
ChannelMessage copyWith({
ChannelMessageStatus? status,
bool? isBookmarked,
List<Repeat>? repeats,
int? repeatCount,
int? pathLength,
@@ -159,6 +162,7 @@ class ChannelMessage {
timestamp: timestamp,
receivedAt: receivedAt,
isOutgoing: isOutgoing,
isBookmarked: isBookmarked ?? this.isBookmarked,
status: status ?? this.status,
repeats: repeats ?? this.repeats,
repeatCount: repeatCount ?? this.repeatCount,
+4
View File
@@ -34,6 +34,7 @@ class Message {
/// to the bottom; [timestamp] stays the sender's identity time.
final DateTime receivedAt;
final bool isOutgoing;
final bool isBookmarked;
final bool isCli;
final MessageStatus status;
final String? originalText;
@@ -62,6 +63,7 @@ class Message {
required this.timestamp,
DateTime? receivedAt,
required this.isOutgoing,
this.isBookmarked = false,
this.isCli = false,
this.status = MessageStatus.pending,
String? messageId,
@@ -108,6 +110,7 @@ class Message {
int? pathLength,
Uint8List? pathBytes,
bool? isCli,
bool? isBookmarked,
Object? originalText = _unset,
Object? translatedText = _unset,
Object? translatedLanguageCode = _unset,
@@ -123,6 +126,7 @@ class Message {
timestamp: timestamp,
receivedAt: receivedAt,
isOutgoing: isOutgoing,
isBookmarked: isBookmarked ?? this.isBookmarked,
isCli: isCli ?? this.isCli,
status: status ?? this.status,
messageId: messageId,
+8
View File
@@ -16,6 +16,7 @@ import '../services/app_settings_service.dart';
import '../services/backup_service.dart';
import '../services/image_codec_service.dart';
import '../services/translation_service.dart';
import '../services/ui_view_state_service.dart';
import '../services/message_filter/message_filter_service.dart';
import '../utils/platform_info.dart';
import '../utils/share_origin.dart';
@@ -201,6 +202,11 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
l10n.backupRestore_discoveredContacts,
Icons.person_search_outlined,
),
_itemTile(
BackupItem.bookmarks,
l10n.backupRestore_bookmarks,
Icons.bookmark_border,
),
const Divider(height: 1, indent: 16),
_groupTile(
title: l10n.backupRestore_channels,
@@ -432,6 +438,7 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
final l10n = context.l10n;
final connector = context.read<MeshCoreConnector>();
final appSettingsService = context.read<AppSettingsService>();
final uiViewStateService = context.read<UiViewStateService>();
final messageFilterService = context.read<MessageFilterService>();
final translationService = context.read<TranslationService>();
final imageCodecService = context.read<ImageCodecService>();
@@ -454,6 +461,7 @@ class _BackupRestoreScreenState extends State<BackupRestoreScreen> {
)) {
await appSettingsService.loadSettings();
if (_selectedItems.contains(BackupItem.appSettings)) {
await uiViewStateService.reload();
await _offerMissingModels(
appSettingsService,
translationService,
+184
View File
@@ -0,0 +1,184 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../helpers/message_url_image_helper.dart';
import '../l10n/l10n.dart';
import '../models/bookmarked_message.dart';
import '../services/app_settings_service.dart';
import '../widgets/chat_send_pipeline.dart';
import '../widgets/empty_state.dart';
import '../widgets/translated_message_content.dart';
class BookmarksScreen extends StatefulWidget {
const BookmarksScreen({super.key});
@override
State<BookmarksScreen> createState() => _BookmarksScreenState();
}
class _BookmarksScreenState extends State<BookmarksScreen> {
late Future<List<BookmarkedMessage>> _bookmarks;
@override
void initState() {
super.initState();
_bookmarks = context.read<MeshCoreConnector>().loadBookmarkedMessages();
}
void _reload() {
setState(() {
_bookmarks = context.read<MeshCoreConnector>().loadBookmarkedMessages();
});
}
Future<void> _remove(BookmarkedMessage bookmark) async {
await context.read<MeshCoreConnector>().setBookmarkedMessage(
bookmark,
isBookmarked: false,
);
if (mounted) _reload();
}
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final publicIpfsGateway = context
.watch<AppSettingsService>()
.settings
.publicIpfsGateway;
return Scaffold(
appBar: AppBar(title: Text(l10n.bookmarks_title), centerTitle: true),
body: FutureBuilder<List<BookmarkedMessage>>(
future: _bookmarks,
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return const Center(child: CircularProgressIndicator());
}
final bookmarks = snapshot.data ?? const <BookmarkedMessage>[];
if (bookmarks.isEmpty) {
return EmptyState(
icon: Icons.bookmark_border,
title: l10n.bookmarks_empty,
);
}
bookmarks.sort((a, b) => a.receivedAt.compareTo(b.receivedAt));
return ListView.builder(
reverse: true,
padding: const EdgeInsets.all(12),
itemCount: bookmarks.length,
itemBuilder: (context, index) {
final bookmark = bookmarks[bookmarks.length - 1 - index];
final sourceType =
bookmark.sourceType == BookmarkSourceType.channel
? l10n.bookmarks_channel
: l10n.bookmarks_contact;
final receivedAt = bookmark.receivedAt.toLocal();
final localizations = MaterialLocalizations.of(context);
final time = localizations.formatTimeOfDay(
TimeOfDay.fromDateTime(receivedAt),
alwaysUse24HourFormat: MediaQuery.alwaysUse24HourFormatOf(
context,
),
);
final dateTime =
'${localizations.formatShortDate(receivedAt)} $time';
final translation = bookmark.translatedText?.trim();
final displayText = translation?.isNotEmpty == true
? translation!
: bookmark.text;
final textStyle =
Theme.of(context).textTheme.bodyMedium ?? const TextStyle();
final textContent = TranslatedMessageContent(
displayText: displayText,
originalText: displayText == bookmark.text
? null
: bookmark.text,
style: textStyle,
originalStyle: textStyle.copyWith(fontStyle: FontStyle.italic),
);
return Card(
margin: const EdgeInsets.only(bottom: 10),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 8, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.only(top: 2, right: 8),
child: Icon(
Icons.bookmark,
size: 20,
color: Color(0xFFFFE54A),
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'$sourceType · ${bookmark.sourceName}',
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 2),
Text(
'${bookmark.senderName} · $dateTime',
style: Theme.of(context).textTheme.bodySmall,
),
],
),
),
IconButton(
tooltip: l10n.common_copy,
onPressed: () =>
copyChatMessageText(context, bookmark.text),
icon: const Icon(Icons.copy),
),
IconButton(
tooltip: l10n.bookmarks_remove,
onPressed: () => _remove(bookmark),
icon: const Icon(Icons.bookmark_remove_outlined),
),
],
),
const SizedBox(height: 8),
if (MessageUrlImageHelper.hasPotentialImageUrl(
bookmark.text,
))
MessageUrlImageFutureBuilder(
messageId: bookmark.messageId,
text: bookmark.text,
publicGateway: publicIpfsGateway,
builder: (context, snapshot) {
final imageUrl = snapshot.data;
if (imageUrl == null) return textContent;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: MessageUrlImagePreview(
imageUrl: imageUrl,
),
),
textContent,
],
);
},
)
else
textContent,
],
),
),
);
},
);
},
),
);
}
}
+142 -28
View File
@@ -31,6 +31,7 @@ import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../models/channel.dart';
import '../models/channel_message.dart';
import '../models/bookmarked_message.dart';
import '../models/image_codec_support.dart' show aeicRatePointForUi;
import '../models/message_filter.dart';
import '../services/app_settings_service.dart' show AppSettingsService;
@@ -167,6 +168,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
/// Message ids picked for a bulk action. Non-empty means selection mode:
/// taps toggle messages and the app bar shows the bulk actions.
final Set<String> _selectedIds = <String>{};
bool _showBookmarkedOnly = false;
bool get _selecting => _selectedIds.isNotEmpty;
@override
@@ -576,6 +578,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
widget.channel,
onSaved: _onChannelEdited,
);
case 'showBookmarks':
setState(() {
_showBookmarkedOnly = !_showBookmarkedOnly;
_selectedIds.clear();
});
case 'background':
showChatBackgroundSheet(
context,
@@ -631,6 +638,14 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
enabled: !readOnly,
child: _menuRow(Icons.settings, context.l10n.channels_editChannel),
),
PopupMenuItem(
value: 'showBookmarks',
child: _menuRow(
_showBookmarkedOnly ? Icons.bookmark : Icons.bookmark_border,
context.l10n.chat_showBookmarks,
color: _showBookmarkedOnly ? const Color(0xFFFFE54A) : null,
),
),
PopupMenuItem(
value: 'background',
child: _menuRow(Icons.wallpaper, context.l10n.chatBackground_title),
@@ -858,13 +873,22 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
final layout = _transcriptLayoutFor(
context,
messages,
showBookmarkedOnly: _showBookmarkedOnly,
);
// Fewer entries than messages means the filter hid or
// collapsed some; make sure older history stays reachable.
final hidesMessages = layout.length < messages.length;
// Fewer entries than messages means the message filter
// hid or collapsed some; bookmark filtering is deliberate.
final hidesMessages =
!_showBookmarkedOnly &&
layout.length < messages.length;
if (hidesMessages) _scheduleHiddenHistoryBackfill();
if (layout.length == 0) {
if (_showBookmarkedOnly) {
return EmptyState(
icon: Icons.bookmark_border,
title: context.l10n.bookmarks_empty,
);
}
final canLoadOlder =
hidesMessages && !_olderHistoryExhausted;
return EmptyState(
@@ -1195,6 +1219,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
: null,
child: MessageBubbleFrame(
isOutgoing: isOutgoing,
isBookmarked: message.isBookmarked || _showBookmarkedOnly,
compact: gifId != null,
maxWidth: constraints.maxWidth,
child: Column(
@@ -1924,9 +1949,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
final connector = context.read<MeshCoreConnector>();
// The picked bytes are kept past the preview on purpose: the sender's own
// bubble renders from them (see [_registerOutgoingImage]). The bitstream
// cannot serve — turning it back into pixels is a ~2.16 GiB, ~1 s decode
// of an image the sender is already holding.
// bubble falls back to them (see [_registerOutgoingImage]) when the sheet
// could not decode the chosen version on this device.
final XFile? picked;
try {
picked = await ImagePicker().pickImage(
@@ -2102,8 +2126,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
/// GRP_DATA is not echoed back to the sender and an image is not a
/// [ChannelMessage], so without this the sender sees a "sent" snack bar and
/// an otherwise empty conversation. The entry lands in `decoded` directly —
/// an outgoing image is never queued for inference, so showing your own
/// photo costs no model memory.
/// an outgoing image is never queued for inference.
///
/// The bubble shows the version the user picked, decoded as recipients see
/// it ([ImageSendPreviewResult.previewPng]). Only when this device could not decode does it fall back
/// to the stretched original.
///
/// Best effort throughout: a failure here has already been preceded by a
/// successful transmission, so it must not turn into an error the user sees.
@@ -2119,7 +2146,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
} on ProviderNotFoundException {
return; // screen test without the store
}
final previewPng = await _squarePreviewPng(sourceBytes);
final previewPng =
result.previewPng ?? await _squarePreviewPng(sourceBytes);
if (previewPng == null) return;
try {
await store.registerOutgoing(
@@ -2133,6 +2161,18 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
rate: aeicRatePointForUi(result.rate),
chunkCount: chunkSet.dataChunkCount,
aspectCode: await _aspectCodeOf(sourceBytes),
// The decoded version is model output and carries the AI label; the
// stretched-original fallback is the sender's own pixels.
synthesized: result.previewPng != null,
payloadBytes: result.payload.length,
// Repeaters may already have echoed the first chunks while the rest
// were still going out.
chunkEchoes: mounted
? context.read<MeshCoreConnector>().ownImageEchoes(
widget.channel.index,
chunkSet.imgId,
)
: null,
);
} on Exception catch (error) {
debugPrint('outgoing image registration failed: $error');
@@ -2160,11 +2200,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
/// [imageBytes] stretched to 512x512, as PNG.
///
/// This is what the preview sheet showed (`BoxFit.fill` on a 1:1 box is
/// exactly the stretch the codec applies) and what the codec actually
/// encoded, so the sender's bubble matches both. Deliberately not a decode of the
/// bitstream: that would cost ~2.16 GiB and ~1 s to reproduce, less well, an
/// image this device is already holding in memory.
/// Fallback for the sender's bubble when the preview sheet had no decoded
/// version to hand over (a device that cannot decode). It is the input the
/// codec stretched, not what recipients see, so it is only a stand-in.
///
/// Returns null rather than throwing on an undecodable source — the send has
/// already happened by the time this runs.
@@ -2219,8 +2257,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
/// `State`'s) — `watch` asserts on that.
_TranscriptLayout _transcriptLayoutFor(
BuildContext context,
List<ChannelMessage> messages,
) {
List<ChannelMessage> messages, {
bool showBookmarkedOnly = false,
}) {
ReceivedImageStore? store;
try {
store = context.watch<ReceivedImageStore>();
@@ -2249,10 +2288,17 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
displayMode,
filterActive,
_revealVersion,
showBookmarkedOnly,
_filteredMessagesSignature(messages),
Object.hashAll(
messages
.where((message) => message.isBookmarked)
.map((message) => message.messageId),
),
);
final cached = _transcriptLayout;
if (cached != null &&
if (!showBookmarkedOnly &&
cached != null &&
cached.matches(
messages,
_imageStoreVersion,
@@ -2261,11 +2307,14 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
)) {
return cached;
}
final images = store == null
final displayedMessages = showBookmarkedOnly
? messages.where((message) => message.isBookmarked).toList()
: messages;
final images = store == null || showBookmarkedOnly
? const <ReceivedImageEntry>[]
: store.entriesForChannel(widget.channel.storageId);
final layout = _TranscriptLayout.build(
messages: messages,
messages: displayedMessages,
images: images,
imageVersion: _imageStoreVersion,
channelIndex: widget.channel.index,
@@ -2407,12 +2456,35 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
right: 8,
bottom: 4,
),
child: Text(
formatChatTime(context, entry.firstSeen),
style: MeshTheme.mono(
fontSize: 12 * textScale,
color: metaColor,
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
formatChatTime(context, entry.firstSeen),
style: MeshTheme.mono(
fontSize: 12 * textScale,
color: metaColor,
),
),
if (isOutgoing) ...[
const SizedBox(width: 4),
// Same status as channel text: repeats heard, here
// for the least-heard data chunk.
MessageStatusIcon(
size: 16 * textScale,
isAcked: false,
isChannel: true,
repeatCount: entry.minDataChunkEchoes ?? 0,
resendProgress: context
.watch<MeshCoreConnector>()
.imageResendProgress(
entry.channelIndex,
entry.imgId,
),
onColor: metaColor,
),
],
],
),
),
],
@@ -2545,6 +2617,15 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
if (entry.recoveredWithParity)
Text(l10n.receivedImage_parityRecovered),
if (decodeMs != null) Text(l10n.receivedImage_decodeTime(decodeMs)),
if (entry.chunkEchoes case final echoes?) ...[
const SizedBox(height: 8),
for (var i = 0; i < echoes.length; i++)
Text(
i < entry.totalChunks
? l10n.receivedImage_packetEchoes(i + 1, echoes[i])
: l10n.receivedImage_recoveryPacketEchoes(echoes[i]),
),
],
],
),
actions: [
@@ -3028,6 +3109,38 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
_markAsUnread(message);
},
),
ListTile(
leading: Icon(
message.isBookmarked
? Icons.bookmark_remove_outlined
: Icons.bookmark_add_outlined,
),
title: Text(
message.isBookmarked
? context.l10n.chat_removeBookmark
: context.l10n.chat_bookmark,
),
onTap: () {
Navigator.pop(sheetContext);
final bookmark = BookmarkedMessage.fromChannel(
message: message,
channelId:
widget.channel.storageId ??
'slot:${widget.channel.index}',
channelName: widget.channel.name,
senderName: message.isOutgoing
? (context.read<MeshCoreConnector>().selfName ??
context.l10n.chat_me)
: message.senderName,
);
unawaited(
context.read<MeshCoreConnector>().setBookmarkedMessage(
bookmark,
isBookmarked: !message.isBookmarked,
),
);
},
),
if (showFilterActions) ...[
const Divider(height: 1),
if (message.isFiltered)
@@ -3128,9 +3241,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
final filterActive = _transcriptLayout?.filterActive ?? true;
return [
for (final m in messages)
if (!(filterActive &&
m.isFiltered &&
!_revealedFilteredIds.contains(m.messageId)))
if ((!_showBookmarkedOnly || m.isBookmarked) &&
!(filterActive &&
m.isFiltered &&
!_revealedFilteredIds.contains(m.messageId)))
m,
];
}
+11
View File
@@ -34,6 +34,7 @@ import '../helpers/contact_share_message.dart';
import '../helpers/gif_helper.dart';
import '../helpers/snack_bar_builder.dart';
import '../helpers/utf8_length_limiter.dart';
import 'bookmarks_screen.dart';
import 'channel_chat_screen.dart';
import 'community_qr_scanner_screen.dart';
import 'contacts_screen.dart';
@@ -128,6 +129,16 @@ class _ChannelsScreenState extends State<ChannelsScreen> {
// context, which is deactivated by then.
itemBuilder: (menuContext) => [
connectionMenuItem(context, menuContext),
PopupMenuItem(
child: MeshMenuItemRow(
icon: Icons.bookmark_border,
label: menuContext.l10n.bookmarks_title,
),
onTap: () => Navigator.push(
context,
MaterialPageRoute(builder: (_) => const BookmarksScreen()),
),
),
PopupMenuItem(
child: MeshMenuItemRow(
icon: Icons.groups,
+65 -1
View File
@@ -28,6 +28,7 @@ import '../helpers/marker_message.dart';
import '../helpers/message_search.dart';
import '../widgets/chat_search_results.dart';
import '../models/channel_message.dart';
import '../models/bookmarked_message.dart';
import '../models/contact.dart';
import '../l10n/contact_localization.dart';
import '../models/message.dart';
@@ -98,6 +99,7 @@ class _ChatScreenState extends State<ChatScreen> {
final _textFieldFocusNode = FocusNode();
final GlobalKey _unreadScrollKey = GlobalKey();
bool _isLoadingOlder = false;
bool _showBookmarkedOnly = false;
MeshCoreConnector? _connector;
Message? _pendingUnreadScrollTarget;
String? _unreadDividerMessageId;
@@ -486,6 +488,10 @@ class _ChatScreenState extends State<ChatScreen> {
_showContactInfo(context);
case 'settings':
_showContactSettings(context);
case 'showBookmarks':
setState(
() => _showBookmarkedOnly = !_showBookmarkedOnly,
);
case 'background':
showChatBackgroundSheet(
context,
@@ -553,6 +559,18 @@ class _ChatScreenState extends State<ChatScreen> {
label: context.l10n.contact_settings,
),
),
PopupMenuItem(
value: 'showBookmarks',
child: MeshMenuItemRow(
icon: _showBookmarkedOnly
? Icons.bookmark
: Icons.bookmark_border,
label: context.l10n.chat_showBookmarks,
color: _showBookmarkedOnly
? const Color(0xFFFFE54A)
: null,
),
),
PopupMenuItem(
value: 'background',
child: MeshMenuItemRow(
@@ -633,6 +651,7 @@ class _ChatScreenState extends State<ChatScreen> {
}
Widget _buildEmptyState() {
if (_showBookmarkedOnly) return _buildBookmarkEmptyState();
return EmptyState(
icon: Icons.chat_bubble_outline,
title: context.l10n.chat_noMessages,
@@ -642,12 +661,23 @@ class _ChatScreenState extends State<ChatScreen> {
);
}
Widget _buildBookmarkEmptyState() => EmptyState(
icon: Icons.bookmark_border,
title: context.l10n.bookmarks_empty,
);
Widget _buildMessageList(
List<Message> messages,
MeshCoreConnector connector,
) {
final visibleMessages = _showBookmarkedOnly
? messages.where((message) => message.isBookmarked).toList()
: messages;
if (_showBookmarkedOnly && visibleMessages.isEmpty) {
return _buildBookmarkEmptyState();
}
// Reverse messages so newest appear at bottom with reverse: true
final reversedMessages = messages.reversed.toList();
final reversedMessages = visibleMessages.reversed.toList();
final itemCount = reversedMessages.length + (_isLoadingOlder ? 1 : 0);
// Auto-scroll to bottom if user is already at bottom
@@ -717,6 +747,7 @@ class _ChatScreenState extends State<ChatScreen> {
: contact.name,
sourceId: widget.contact.publicKeyHex,
textScale: textScale,
isBookmarked: message.isBookmarked || _showBookmarkedOnly,
onLongPress: () => _showMessageActions(message, contact),
onRetryReaction: (msg, emoji) =>
_sendReaction(msg, contact, emoji),
@@ -1461,6 +1492,36 @@ class _ChatScreenState extends State<ChatScreen> {
_markAsUnread(message);
},
),
ListTile(
leading: Icon(
message.isBookmarked
? Icons.bookmark_remove_outlined
: Icons.bookmark_add_outlined,
),
title: Text(
message.isBookmarked
? context.l10n.chat_removeBookmark
: context.l10n.chat_bookmark,
),
onTap: () {
Navigator.pop(sheetContext);
final bookmark = BookmarkedMessage.fromContact(
message: message,
contactKey: widget.contact.publicKeyHex,
contactName: widget.contact.name,
senderName: message.isOutgoing
? (context.read<MeshCoreConnector>().selfName ??
context.l10n.chat_me)
: contact.name,
);
unawaited(
context.read<MeshCoreConnector>().setBookmarkedMessage(
bookmark,
isBookmarked: !message.isBookmarked,
),
);
},
),
if (message.isOutgoing && message.status == MessageStatus.failed)
ListTile(
enabled: !readOnly,
@@ -1571,12 +1632,14 @@ class _MessageBubble extends StatelessWidget {
final void Function(Message message, String emoji)? onRetryReaction;
final double textScale;
final String sourceId;
final bool isBookmarked;
const _MessageBubble({
required this.message,
required this.senderName,
required this.sourceId,
required this.textScale,
required this.isBookmarked,
this.onLongPress,
this.onRetryReaction,
});
@@ -1669,6 +1732,7 @@ class _MessageBubble extends StatelessWidget {
child: MessageBubbleFrame(
isOutgoing: isOutgoing,
isFailed: isFailed,
isBookmarked: isBookmarked,
compact: gifId != null,
maxWidth: constraints.maxWidth,
child: Column(
+96
View File
@@ -1,10 +1,18 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:file_selector/file_selector.dart';
import 'package:flutter/material.dart';
import 'package:meshcore_open/utils/gpx_export.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
import '../connector/meshcore_connector.dart';
import '../helpers/snack_bar_builder.dart';
import '../l10n/l10n.dart';
import '../services/app_settings_service.dart';
import '../utils/bookmark_markdown_export.dart';
import '../utils/platform_info.dart';
import '../utils/share_origin.dart';
import '../widgets/app_bar.dart';
import '../widgets/mesh_ui.dart';
@@ -12,6 +20,12 @@ import '../widgets/mesh_nav_tile.dart';
import '../widgets/sync_progress_overlay.dart';
class ExportScreen extends StatelessWidget {
static const _markdownFileType = XTypeGroup(
label: 'Markdown',
extensions: ['md'],
mimeTypes: ['text/markdown'],
);
const ExportScreen({super.key});
@override
@@ -34,6 +48,16 @@ class ExportScreen extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
children: [
SectionHeader(l10n.settings_export),
MeshCard(
padding: EdgeInsets.zero,
child: MeshNavTile(
icon: Icons.bookmark_border,
title: l10n.settings_exportBookmarks,
subtitle: l10n.settings_exportBookmarksSubtitle,
onTap: () => _exportBookmarks(context),
),
),
const SizedBox(height: 16),
MeshCard(
padding: EdgeInsets.zero,
child: Column(
@@ -94,6 +118,78 @@ class ExportScreen extends StatelessWidget {
);
}
Future<void> _exportBookmarks(BuildContext context) async {
final l10n = context.l10n;
try {
final bookmarks = await context
.read<MeshCoreConnector>()
.loadBookmarkedMessages();
if (!context.mounted) return;
if (bookmarks.isEmpty) {
showDismissibleSnackBar(
context,
content: Text(l10n.settings_exportBookmarksNoBookmarks),
);
return;
}
final exportedAt = DateTime.now();
final markdown = await buildBookmarksMarkdown(
bookmarks,
publicGateway: context
.read<AppSettingsService>()
.settings
.publicIpfsGateway,
exportedAt: exportedAt,
);
if (!context.mounted) return;
final date =
'${exportedAt.year.toString().padLeft(4, '0')}'
'-${exportedAt.month.toString().padLeft(2, '0')}'
'-${exportedAt.day.toString().padLeft(2, '0')}';
final filename = 'meshcore-open-bookmarks_$date.md';
final file = XFile.fromData(
Uint8List.fromList(utf8.encode(markdown)),
name: filename,
mimeType: 'text/markdown',
);
if (PlatformInfo.isWeb) {
await file.saveTo(filename);
} else if (PlatformInfo.isDesktop) {
final location = await getSaveLocation(
suggestedName: filename,
acceptedTypeGroups: const [_markdownFileType],
);
if (location == null || !context.mounted) return;
await file.saveTo(location.path);
} else {
final result = await SharePlus.instance.share(
ShareParams(
subject: l10n.settings_exportBookmarks,
files: [file],
fileNameOverrides: [filename],
sharePositionOrigin: shareOriginOf(context),
),
);
if (result.status == ShareResultStatus.dismissed) return;
}
if (context.mounted) {
showDismissibleSnackBar(
context,
content: Text(l10n.settings_exportBookmarksSuccess),
);
}
} catch (error) {
if (context.mounted) {
showDismissibleSnackBar(
context,
content: Text('${l10n.settings_gpxExportError} $error'),
);
}
}
}
Future<void> _gpxExport(
BuildContext context,
GpxExport exporter,
+23 -3
View File
@@ -49,6 +49,7 @@ const List<String> _scopedPreferencePrefixes = [
..._contactPreferencePrefixes,
..._channelPreferencePrefixes,
'discovered_contacts',
'message_bookmarks_',
];
enum BackupSection {
@@ -75,6 +76,7 @@ enum BackupItem {
contactGroups,
contactHistory,
discoveredContacts,
bookmarks,
channels,
channelFilters,
ipfsKey,
@@ -485,6 +487,12 @@ class BackupService {
);
}
}
if (selectedItems.contains(BackupItem.appSettings)) {
await appSettingsService.loadSettings();
}
if (selectedItems.contains(BackupItem.channelSettings)) {
await connector.reloadChannelOrder();
}
if (!importingIdentity &&
selectedItems.contains(BackupItem.discoveredContacts)) {
await connector.reloadDiscoveredContacts();
@@ -1055,7 +1063,8 @@ class BackupService {
BackupItem.perContactSettings ||
BackupItem.contactGroups ||
BackupItem.contactHistory => BackupSection.contacts,
BackupItem.discoveredContacts => BackupSection.discoveredContacts,
BackupItem.discoveredContacts ||
BackupItem.bookmarks => BackupSection.discoveredContacts,
BackupItem.channels ||
BackupItem.channelFilters ||
BackupItem.channelSettings ||
@@ -1108,6 +1117,10 @@ class BackupService {
key.startsWith('discovered_contacts$devicePrefix')) {
return true;
}
if (items.contains(BackupItem.bookmarks) &&
key.startsWith('message_bookmarks_$devicePrefix')) {
return true;
}
if (items.contains(BackupItem.channels) &&
(key.startsWith('channels$devicePrefix') ||
key.startsWith('channel_slot_ids_$devicePrefix'))) {
@@ -1156,6 +1169,7 @@ class BackupService {
case BackupSection.discoveredContacts:
return _startsWithScopedPrefix(key, const [
'discovered_contacts',
'message_bookmarks_',
], devicePrefix);
case BackupSection.channels:
return key.startsWith('message_filter_') ||
@@ -1348,7 +1362,10 @@ class BackupService {
if (sourcePrefix.isEmpty || destinationPrefix.isEmpty) return key;
final prefixes = switch (section) {
BackupSection.contacts => _contactPreferencePrefixes,
BackupSection.discoveredContacts => const ['discovered_contacts'],
BackupSection.discoveredContacts => const [
'discovered_contacts',
'message_bookmarks_',
],
BackupSection.channels => _channelPreferencePrefixes,
_ => const <String>[],
};
@@ -1373,7 +1390,10 @@ class BackupService {
if (devicePrefix.isEmpty) return false;
final prefixes = switch (section) {
BackupSection.contacts => _contactPreferencePrefixes,
BackupSection.discoveredContacts => const ['discovered_contacts'],
BackupSection.discoveredContacts => const [
'discovered_contacts',
'message_bookmarks_',
],
BackupSection.channels => _channelPreferencePrefixes,
_ => const <String>[],
};
+19 -18
View File
@@ -970,15 +970,17 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
/// [ImageSendCodec] entry point used by `ImageSendPreviewSheet`.
///
/// Takes the raw picked file (JPEG/PNG/HEIC/…), centre-crops and scales it to
/// [kImageCodecSquareSize] square, then encodes. Throws on failure so the
/// Takes the raw picked file (JPEG/PNG/HEIC/…), stretches the part of it
/// that [variant] selects (see [rerollSourceRect]; 0 is the whole photo) to
/// a [kImageCodecSquareSize] square, then encodes. Throws on failure so the
/// sheet can surface it — unlike the nullable service-level methods below,
/// whose contract is "null means not available".
@override
Future<Uint8List> encode(
Uint8List imageBytes,
ImageCodecRatePoint rate,
) async {
ImageCodecRatePoint rate, {
int variant = 0,
}) async {
if (!kImageCodecBitstreamPathAvailable) {
// Fail here rather than after a 512x512 raster and a session load, and
// fail with the specific exception so the sheet can say why.
@@ -990,7 +992,7 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
throw const ImageCodecBundleIncomplete();
}
final result = await encodeImage(
rgbBytes: await _toSquareRgb(imageBytes),
rgbBytes: await _toSquareRgb(imageBytes, variant: variant),
ratePoint: aeicRatePointForUi(rate),
);
final bitstream = result?.bitstream;
@@ -1300,14 +1302,18 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
static const int _bytesPerPixel = 3;
/// Centre-crops [imageBytes] to a square and scales it to
/// [kImageCodecSquareSize], returning packed 8-bit RGB.
/// Stretches the [variant] region of [imageBytes] (see [rerollSourceRect];
/// 0 is the whole frame) to a [kImageCodecSquareSize] square, returning
/// packed 8-bit RGB.
///
/// Uses `dart:ui` rather than a decode package so this adds no dependency.
/// It runs on the root isolate, which is acceptable: it is a single 512x512
/// raster, three orders of magnitude cheaper than the 1385 GFLOP inference
/// that follows in the worker.
Future<Uint8List> _toSquareRgb(Uint8List imageBytes) async {
Future<Uint8List> _toSquareRgb(
Uint8List imageBytes, {
int variant = 0,
}) async {
final codec = await ui.instantiateImageCodec(imageBytes);
final frame = await codec.getNextFrame();
final source = frame.image;
@@ -1317,16 +1323,11 @@ class ImageCodecService extends ChangeNotifier implements ImageSendCodec {
// Aspect ratio is deliberately not preserved: the codec's graph is
// statically 512x512, so something has to give, and losing 25% of a 4:3
// photo (44% of 16:9, or the subject's head in a portrait) is worse than
// distorting it. Nothing outside the frame is discarded this way.
// NOTE: the aspect ratio is NOT transmitted, so the receiver cannot undo
// the stretch — see the note in image_chunk_transport.dart on the
// metadata byte.
final src = ui.Rect.fromLTWH(
0,
0,
source.width.toDouble(),
source.height.toDouble(),
);
// distorting it. The source shape travels in the metadata byte's aspect
// nibble, so the receiver un-stretches it. Re-roll variants trim at most
// ~2% at an edge, so they keep the same shape and aspect code.
final r = rerollSourceRect(source.width, source.height, variant);
final src = ui.Rect.fromLTWH(r.left, r.top, r.width, r.height);
final dstSize = kImageCodecSquareSize.toDouble();
final recorder = ui.PictureRecorder();
ui.Canvas(recorder).drawImageRect(
+66 -6
View File
@@ -197,13 +197,30 @@ class ReceivedImageEntry {
/// One chunk was rebuilt from the XOR parity chunk.
final bool recoveredWithParity;
/// This is the local user's own send. Its PNG is their real 512x512 crop, so
/// [synthesized] is false and the R6 label must NOT be shown.
/// This is the local user's own send.
final bool isOutgoing;
/// Whether the pixels are generative-model output. Derived, never supplied:
/// `synthesized == !isOutgoing`.
bool get synthesized => !isOutgoing;
/// Whether the pixels are generative-model output, so the R6 label must be
/// shown. Always true for received images. For the user's own send it is
/// true when the PNG is the version they picked, decoded as recipients see
/// it, and false only when it is the stretched original (a device that
/// could not decode).
final bool synthesized;
/// Our own image only: repeater echoes heard for each chunk, data chunks
/// first and the parity chunk last. Null when not tracked.
final List<int>? chunkEchoes;
/// The fewest echoes any data chunk got: every data chunk was heard
/// repeated at least this many times. Null when not tracked.
int? get minDataChunkEchoes {
final echoes = chunkEchoes;
if (echoes == null || echoes.isEmpty) return null;
final data = echoes.length > totalChunks
? echoes.sublist(0, totalChunks)
: echoes;
return data.reduce((a, b) => a < b ? a : b);
}
final int? decodeMs;
final String? error;
@@ -237,6 +254,8 @@ class ReceivedImageEntry {
this.metadataAssumed = true,
this.recoveredWithParity = false,
this.isOutgoing = false,
bool? synthesized,
this.chunkEchoes,
this.decodeMs,
this.error,
this.needsManualDecode = false,
@@ -245,7 +264,7 @@ class ReceivedImageEntry {
this.bitstreamByteCount = 0,
this.pngByteCount = 0,
this.pngBytes,
});
}) : synthesized = synthesized ?? !isOutgoing;
ImageStreamKey get key => ImageStreamKey(
senderPrefix: senderPrefix,
@@ -282,6 +301,7 @@ class ReceivedImageEntry {
int? bitstreamByteCount,
int? pngByteCount,
Object? pngBytes = _unset,
List<int>? chunkEchoes,
}) {
return ReceivedImageEntry(
streamId: streamId,
@@ -299,6 +319,8 @@ class ReceivedImageEntry {
metadataAssumed: metadataAssumed ?? this.metadataAssumed,
recoveredWithParity: recoveredWithParity ?? this.recoveredWithParity,
isOutgoing: isOutgoing,
synthesized: synthesized,
chunkEchoes: chunkEchoes ?? this.chunkEchoes,
decodeMs: identical(decodeMs, _unset) ? this.decodeMs : decodeMs as int?,
error: identical(error, _unset) ? this.error : error as String?,
needsManualDecode: needsManualDecode ?? this.needsManualDecode,
@@ -329,6 +351,7 @@ class ReceivedImageEntry {
'recoveredWithParity': recoveredWithParity,
'isOutgoing': isOutgoing,
'synthesized': synthesized,
if (chunkEchoes != null) 'chunkEchoes': chunkEchoes,
'needsManualDecode': needsManualDecode,
'bitstreamStored': bitstreamStored,
'pngStored': pngStored,
@@ -357,6 +380,10 @@ class ReceivedImageEntry {
metadataAssumed: json['metadataAssumed'] as bool? ?? true,
recoveredWithParity: json['recoveredWithParity'] as bool? ?? false,
isOutgoing: json['isOutgoing'] as bool? ?? false,
synthesized: json['synthesized'] as bool?,
chunkEchoes: (json['chunkEchoes'] as List<dynamic>?)
?.whereType<int>()
.toList(),
decodeMs: json['decodeMs'] as int?,
error: json['error'] as String?,
needsManualDecode: json['needsManualDecode'] as bool? ?? false,
@@ -1041,6 +1068,9 @@ class ReceivedImageStore extends ChangeNotifier {
required AeicRatePoint rate,
required int chunkCount,
int aspectCode = 0,
bool synthesized = false,
List<int>? chunkEchoes,
int payloadBytes = 0,
DateTime? at,
}) async {
final now = at ?? _clock();
@@ -1069,6 +1099,11 @@ class ReceivedImageStore extends ChangeNotifier {
aspectCode: aspectCode,
metadataAssumed: false,
isOutgoing: true,
synthesized: synthesized,
chunkEchoes: chunkEchoes,
// The size of what was sent, for the caption and packet info. The
// bitstream itself is not kept, so bitstreamStored stays false.
bitstreamByteCount: payloadBytes,
pngStored: pngWritten,
pngByteCount: pngWritten ? previewPng.length : 0,
pngBytes: previewPng,
@@ -1078,6 +1113,31 @@ class ReceivedImageStore extends ChangeNotifier {
return stored;
}
/// Records repeater echoes of the user's own image (see
/// `MeshCoreConnector.ownImageEchoes`). Echoes that land before the image is
/// registered are passed to [registerOutgoing] instead.
Future<void> setOutgoingEchoes({
required int channelIndex,
required int senderPrefix,
required int imgId,
required List<int> echoes,
}) async {
ReceivedImageEntry? match;
for (final entry in _entries.values) {
if (!entry.isOutgoing ||
entry.imgId != imgId ||
entry.channelIndex != channelIndex ||
entry.senderPrefix != senderPrefix) {
continue;
}
if (match == null || entry.firstSeen.isAfter(match.firstSeen)) {
match = entry;
}
}
if (match == null) return;
await _store(match.copyWith(chunkEchoes: List<int>.unmodifiable(echoes)));
}
// ---- decode scheduling ---------------------------------------------------
/// App lifecycle gate. Backgrounding cancels an in-flight decode and returns
+5
View File
@@ -109,6 +109,11 @@ class UiViewStateService extends ChangeNotifier {
}
}
Future<void> reload() async {
await initialize();
notifyListeners();
}
void setContactsSelectedGroupName(String value) {
if (_contactsSelectedGroupName == value) return;
_contactsSelectedGroupName = value;
+92
View File
@@ -0,0 +1,92 @@
import 'dart:convert';
import '../models/bookmarked_message.dart';
import '../utils/app_logger.dart';
import 'prefs_manager.dart';
class BookmarkStore {
static const String _keyPrefix = 'message_bookmarks_';
String publicKeyHex = '';
set setPublicKeyHex(String value) =>
publicKeyHex = value.length > 10 ? value.substring(0, 10) : '';
String get keyFor => '$_keyPrefix$publicKeyHex';
Future<void> _pendingWrites = Future<void>.value();
Future<List<BookmarkedMessage>> loadBookmarks() async {
final writes = _pendingWrites;
await writes;
return _readBookmarks(keyFor);
}
Future<void> saveBookmark(BookmarkedMessage bookmark) {
if (publicKeyHex.isEmpty) return Future<void>.value();
final key = keyFor;
return _enqueue(() async {
final bookmarks = await _readBookmarks(key);
bookmarks.removeWhere(
(existing) => existing.storageId == bookmark.storageId,
);
bookmarks.add(bookmark);
await _writeBookmarks(key, bookmarks);
});
}
Future<void> removeBookmark(BookmarkedMessage bookmark) {
if (publicKeyHex.isEmpty) return Future<void>.value();
final key = keyFor;
return _enqueue(() async {
final bookmarks = await _readBookmarks(key);
bookmarks.removeWhere(
(existing) => existing.storageId == bookmark.storageId,
);
await _writeBookmarks(key, bookmarks);
});
}
Future<void> _enqueue(Future<void> Function() operation) {
final next = _pendingWrites.then((_) => operation());
_pendingWrites = next.then<void>(
(_) {},
onError: (Object _, StackTrace _) {},
);
return next;
}
Future<List<BookmarkedMessage>> _readBookmarks(String key) async {
if (key == _keyPrefix) return [];
final raw = PrefsManager.instance.getString(key);
if (raw == null || raw.isEmpty) return [];
try {
final decoded = jsonDecode(raw);
if (decoded is! List) return [];
final bookmarks = <BookmarkedMessage>[];
for (final value in decoded) {
if (value is! Map<String, dynamic>) continue;
try {
bookmarks.add(BookmarkedMessage.fromJson(value));
} on Object catch (error) {
appLogger.warn('Skipping malformed bookmark: $error');
}
}
return bookmarks;
} on FormatException catch (error) {
appLogger.warn('Stored bookmarks are unreadable: $error');
return [];
}
}
Future<void> _writeBookmarks(
String key,
List<BookmarkedMessage> bookmarks,
) async {
if (!await PrefsManager.instance.setString(
key,
jsonEncode(bookmarks.map((bookmark) => bookmark.toJson()).toList()),
)) {
throw StateError('Could not save bookmarks');
}
}
}
+12
View File
@@ -123,6 +123,16 @@ class ChannelMessageStore {
return messages;
}
Future<void> updateBookmarkFlag(
String channelId,
String messageId,
bool isBookmarked,
) => _archive.updateBookmarkFlag(
_keyForChannel(channelId),
messageId,
isBookmarked,
);
Future<void> clearChannelMessages(String channelId) =>
_archive.clear(HistoryStore.instance, _keyForChannel(channelId));
@@ -149,6 +159,7 @@ class ChannelMessageStore {
'timestamp': msg.timestamp.millisecondsSinceEpoch,
'receivedAt': msg.receivedAt.millisecondsSinceEpoch,
'isOutgoing': msg.isOutgoing,
'isBookmarked': msg.isBookmarked,
'status': msg.status.index,
'channelIndex': msg.channelIndex,
'region': msg.region,
@@ -226,6 +237,7 @@ class ChannelMessageStore {
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] as int),
receivedAt: legacyAwareReceivedAt(json),
isOutgoing: json['isOutgoing'] as bool? ?? false,
isBookmarked: json['isBookmarked'] as bool? ?? false,
status: _statusAt(json['status']) ?? ChannelMessageStatus.failed,
repeatCount: (json['repeatCount'] as int?) ?? 0,
pathLength: decodedPathLength,
+45
View File
@@ -121,6 +121,51 @@ class HistoryArchive {
(_archives[HistoryStore.instance] ??= {})[key] = _ArchiveState(count);
}
Future<void> updateBookmarkFlag(
String key,
String messageId,
bool isBookmarked,
) {
final store = HistoryStore.instance;
final state = _stateFor(store, key);
return _serialize(store, key, () async {
String? update(String raw) {
try {
final decoded = jsonDecode(raw);
if (decoded is! Map<String, dynamic> ||
mergeKey(decoded) != 'id:$messageId') {
return null;
}
decoded['isBookmarked'] = isBookmarked;
return jsonEncode(decoded);
} on FormatException {
return null;
}
}
for (var i = 0; i < state.pending.length; i++) {
final entry = state.pending[i];
final replacement = update(entry.$2);
if (replacement != null) state.pending[i] = (entry.$1, replacement);
}
final entries = await store.readEntries(key);
var changed = false;
final updated = <String>[];
for (final entry in entries) {
final replacement = update(entry);
updated.add(replacement ?? entry);
changed = changed || replacement != null;
}
if (changed &&
!await store.setString(
key,
jsonEncode(updated.map(jsonDecode).toList()),
)) {
throw StateError('Could not update message bookmark flag');
}
});
}
/// Only entries trimmed since the last successful save need buffering.
void archive(String key, Iterable<String> entries) {
final state = _stateFor(HistoryStore.instance, key);
+15
View File
@@ -175,6 +175,19 @@ class MessageStore {
return messages;
}
Future<void> updateBookmarkFlag(
String contactKeyHex,
String messageId,
bool isBookmarked,
) {
if (publicKeyHex.isEmpty) return Future<void>.value();
return _archive.updateBookmarkFlag(
'$keyFor$contactKeyHex',
messageId,
isBookmarked,
);
}
Future<void> clearMessages(String contactKeyHex) {
if (publicKeyHex.isEmpty) return Future<void>.value();
return _archive.clear(HistoryStore.instance, '$keyFor$contactKeyHex');
@@ -187,6 +200,7 @@ class MessageStore {
'timestamp': msg.timestamp.millisecondsSinceEpoch,
'receivedAt': msg.receivedAt.millisecondsSinceEpoch,
'isOutgoing': msg.isOutgoing,
'isBookmarked': msg.isBookmarked,
'isCli': msg.isCli,
'status': msg.status.index,
'messageId': msg.messageId,
@@ -257,6 +271,7 @@ class MessageStore {
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] as int),
receivedAt: legacyAwareReceivedAt(json),
isOutgoing: json['isOutgoing'] as bool? ?? false,
isBookmarked: json['isBookmarked'] as bool? ?? false,
isCli: isCli,
status: _statusAt(json['status']) ?? MessageStatus.failed,
messageId: json['messageId'] as String?,
+165
View File
@@ -0,0 +1,165 @@
import '../helpers/message_url_image_helper.dart';
import '../models/bookmarked_message.dart';
Future<String> buildBookmarksMarkdown(
List<BookmarkedMessage> bookmarks, {
required String publicGateway,
DateTime? exportedAt,
}) async {
final date = (exportedAt ?? DateTime.now()).toLocal();
final output = StringBuffer()
..writeln('# MeshCore-Open Bookmarks')
..writeln()
..writeln('Exported: ${_date(date)}')
..writeln();
final contacts = _groupBySource(
bookmarks.where(
(bookmark) => bookmark.sourceType == BookmarkSourceType.contact,
),
);
if (contacts.isNotEmpty) {
output.writeln('## Contacts');
for (final group in contacts) {
output
..writeln()
..writeln('### ${_safeHeading(group.first.sourceName)}')
..writeln();
await _writeGroup(output, group, publicGateway: publicGateway);
}
}
final channels = _groupBySource(
bookmarks.where(
(bookmark) => bookmark.sourceType == BookmarkSourceType.channel,
),
);
if (channels.isNotEmpty) {
if (contacts.isNotEmpty) output.writeln();
output.writeln('## Channels');
for (final group in channels) {
final name = _singleLine(group.first.sourceName);
output
..writeln()
..writeln('### $name')
..writeln();
await _writeGroup(output, group, publicGateway: publicGateway);
}
}
return '${output.toString().trimRight()}\n';
}
List<List<BookmarkedMessage>> _groupBySource(
Iterable<BookmarkedMessage> bookmarks,
) {
final bySource = <String, List<BookmarkedMessage>>{};
for (final bookmark in bookmarks) {
bySource.putIfAbsent(bookmark.sourceId, () => []).add(bookmark);
}
final groups = bySource.values.toList();
for (final group in groups) {
group.sort((a, b) => a.receivedAt.compareTo(b.receivedAt));
}
groups.sort((a, b) {
final byName = a.first.sourceName.compareTo(b.first.sourceName);
return byName != 0 ? byName : a.first.sourceId.compareTo(b.first.sourceId);
});
return groups;
}
Future<void> _writeGroup(
StringBuffer output,
List<BookmarkedMessage> bookmarks, {
required String publicGateway,
}) async {
for (var i = 0; i < bookmarks.length; i++) {
final bookmark = bookmarks[i];
output
..writeln(
'**${_safeInline(bookmark.senderName)} · ${_dateTime(bookmark.receivedAt)}**',
)
..writeln();
final translation = bookmark.translatedText?.trim();
if (translation != null &&
translation.isNotEmpty &&
translation != bookmark.text) {
output
..write('*${_markdownLinks(bookmark.text)}*')
..writeln()
..writeln(_markdownLinks(translation));
} else {
output.writeln(_markdownLinks(bookmark.text));
}
final imageUrl = await MessageUrlImageHelper.parse(
bookmark.text,
publicGateway: publicGateway,
respectLoadSetting: false,
);
if (imageUrl != null) {
final destination = _markdownDestination(imageUrl);
output
..writeln()
..writeln('![Image]($destination)')
..writeln()
..writeln('[Image URL]($destination)');
}
if (i < bookmarks.length - 1) output.writeln();
}
}
String _singleLine(String value) =>
value.replaceAll(RegExp(r'[\r\n]+'), ' ').trim();
String _markdownLinks(String text) {
final urls = RegExp(
r'''(?:https?://|ipfs:(?:/{0,2}))[\w\-._~:/?#\[\]@!$&'()*+,;=%]+''',
caseSensitive: false,
);
final linked = text.trim().replaceAllMapped(urls, (match) {
final raw = match.group(0)!;
var url = raw;
while (url.isNotEmpty && RegExp(r'[.,!?;:]$').hasMatch(url)) {
url = url.substring(0, url.length - 1);
}
while (url.endsWith(')') &&
'('.allMatches(url).length < ')'.allMatches(url).length) {
url = url.substring(0, url.length - 1);
}
if (url.isEmpty) return raw;
final suffix = raw.substring(url.length);
final label = url.replaceAll('[', r'\[').replaceAll(']', r'\]');
return '[$label](${_markdownDestination(url)})$suffix';
});
return linked
.replaceFirst(RegExp(r'^\*+'), '')
.replaceFirst(RegExp(r'\*+$'), '')
.trim();
}
String _markdownDestination(String url) => url
.replaceAll('<', '%3C')
.replaceAll('>', '%3E')
.replaceAll(' ', '%20')
.replaceAll('(', '%28')
.replaceAll(')', '%29');
String _safeHeading(String value) =>
value.replaceAll(RegExp(r'[\r\n]+'), ' ').replaceAll('#', r'\#');
String _safeInline(String value) => value
.replaceAll(RegExp(r'[\r\n]+'), ' ')
.replaceAll('*', r'\*')
.replaceAll('_', r'\_');
String _date(DateTime date) =>
'${date.year.toString().padLeft(4, '0')}-'
'${date.month.toString().padLeft(2, '0')}-'
'${date.day.toString().padLeft(2, '0')}';
String _dateTime(DateTime date) =>
'${_date(date)} ${date.hour.toString().padLeft(2, '0')}:'
'${date.minute.toString().padLeft(2, '0')}';
+79 -8
View File
@@ -98,6 +98,54 @@ class ImageCodecRateStats {
}
}
/// Input tweaks for "Try another version", as `(zoom, dx, dy)` fractions of
/// the source photo. Index == version variant; 0 is the untouched photo.
///
/// The decoder is generative and very sensitive to its input: a near-identical
/// photo can come back with different invented detail. Measured on Kodak, the
/// best of three versions raised CLIP agreement with the source from 0.828 to
/// 0.853 and fixed 3 of 8 photos that came back as something else
/// (`tools/aeic/eval`, `reroll*` variants, which mirror this table). The tweaks
/// drop at most ~2% at an edge, so every version still shows the whole photo
/// and keeps the same aspect code.
const List<(double, double, double)> kImageSendRerollTweaks = [
(1.0, 0.0, 0.0),
(1.02, 0.005, 0.0),
(1.02, -0.005, 0.005),
(1.04, 0.0, -0.005),
(1.03, 0.01, 0.01),
(1.03, -0.01, -0.01),
];
/// Most versions the send sheet will make of one photo.
final int kImageSendMaxVersions = kImageSendRerollTweaks.length;
/// The part of a [width] x [height] photo that version [variant] encodes.
///
/// Variant 0 is the full frame, so the first version is exactly what the app
/// sent before versions existed. Other variants zoom in by `zoom`, shift by
/// `dx`/`dy` of the photo size, and are clamped to stay inside the photo.
({double left, double top, double width, double height}) rerollSourceRect(
int width,
int height,
int variant,
) {
if (variant < 0 || variant >= kImageSendRerollTweaks.length) {
throw RangeError.range(
variant,
0,
kImageSendRerollTweaks.length - 1,
'variant',
);
}
final (zoom, dx, dy) = kImageSendRerollTweaks[variant];
final w = width / zoom;
final h = height / zoom;
final left = ((width - w) / 2 + dx * width).clamp(0.0, width - w);
final top = ((height - h) / 2 + dy * height).clamp(0.0, height - h);
return (left: left, top: top, width: w, height: h);
}
/// The encode interface the preview sheet consumes.
abstract class ImageSendCodec {
/// Current availability. The sheet renders a non-interactive explanation for
@@ -118,9 +166,14 @@ abstract class ImageSendCodec {
/// Encode [imageBytes] (any common still format) at [rate], returning the
/// compressed bitstream that will be chunked onto the air.
///
/// Implementations are expected to centre-crop to
/// [kImageCodecSquareSize] square first.
Future<Uint8List> encode(Uint8List imageBytes, ImageCodecRatePoint rate);
/// Implementations stretch the part of the photo given by
/// [rerollSourceRect] for [variant] into a [kImageCodecSquareSize] square
/// first. Variant 0 is the whole photo.
Future<Uint8List> encode(
Uint8List imageBytes,
ImageCodecRatePoint rate, {
int variant = 0,
});
/// Decodes [payload] to PNG exactly as a recipient would, or null when this
/// device cannot decode.
@@ -142,26 +195,44 @@ class FakeImageSendCodec implements ImageSendCodec {
final Duration latency;
/// Returned by [decodePreview]; null means "this device cannot decode".
final Uint8List? previewPng;
const FakeImageSendCodec({
this.availability = ImageCodecAvailability.ready,
this.unavailableReason,
this.latency = const Duration(milliseconds: 250),
this.previewPng,
});
/// Payload size the fake produces for [variant]: the measured mean, plus a
/// little per variant so versions are told apart.
static int payloadBytesFor(ImageCodecRatePoint rate, int variant) =>
ImageCodecRateStats.forRate(rate).meanBytes + variant * 3;
@override
Future<Uint8List> encode(
Uint8List imageBytes,
ImageCodecRatePoint rate,
) async {
ImageCodecRatePoint rate, {
int variant = 0,
}) async {
if (latency > Duration.zero) {
await Future<void>.delayed(latency);
}
final size = ImageCodecRateStats.forRate(rate).meanBytes;
final size = payloadBytesFor(rate, variant);
return Uint8List.fromList(
List<int>.generate(size, (i) => (i * 31 + rate.index) & 0xFF),
List<int>.generate(
size,
(i) => (i * 31 + rate.index + variant * 7) & 0xFF,
),
);
}
@override
Future<Uint8List?> decodePreview(Uint8List payload) async => null;
Future<Uint8List?> decodePreview(Uint8List payload) async {
if (latency > Duration.zero) {
await Future<void>.delayed(latency);
}
return previewPng;
}
}
+308 -91
View File
@@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../l10n/l10n.dart';
import '../theme/mesh_theme.dart';
import '../services/image_chunk_transport.dart';
import '../utils/lora_airtime.dart';
import 'image_send_codec_binding.dart';
@@ -37,6 +38,11 @@ class ImageSendPreviewResult {
/// actually shown. Null when the radio settings were unknown.
final Duration? wallClock;
/// The chosen version decoded as recipients will see it (a
/// 512x512 PNG, stretched like the codec input), or null if this device
/// could not decode. Used for the sender's own chat bubble.
final Uint8List? previewPng;
const ImageSendPreviewResult({
required this.payload,
required this.rate,
@@ -44,6 +50,7 @@ class ImageSendPreviewResult {
required this.packetCount,
required this.airtime,
required this.wallClock,
this.previewPng,
});
}
@@ -141,29 +148,53 @@ class _RateEstimate {
bool get isExact => payloadBytes != null;
}
/// One encoded version of the photo: the whole photo with re-roll tweak
/// [variant] (see [rerollSourceRect]), its bitstream, and what recipients will
/// see when they decode it.
class _Version {
_Version(this.variant);
final int variant;
Uint8List? payload;
Uint8List? png;
bool encoding = true;
bool decoding = false;
/// The encode failed; there is nothing to send for this version.
bool get failed => !encoding && payload == null;
}
class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
/// The encoded ft32 bitstream, once the encode finishes.
Uint8List? _encoded;
/// Versions made so far, in the order they were made. Version 1 (variant 0)
/// is the photo exactly as the app has always encoded it; more are added only
/// when the user taps "Try another version".
final List<_Version> _versions = [];
int _selected = 0;
late bool _parity;
bool _encoding = false;
bool _sending = false;
bool _failed = false;
/// Latest radio params seen in build; used by [_onSend] so the confirm path
/// does not have to touch an InheritedWidget after an await.
ImageSendRadio? _radio;
/// Source `width / height`. Recipients un-stretch the 512x512 square back to
/// this shape, so both preview views use it.
/// Source `width / height`, used when the original is shown.
double _aspect = 1;
// The shape recipients restore: the nearest supported ratio, or square.
double _recipientAspect = 1;
bool _showReconstruction = false;
Uint8List? _reconstruction;
bool _reconstructing = false;
bool _reconstructionUnavailable = false;
/// The main preview shows the original photo instead of the reconstruction.
bool _showOriginal = false;
/// This device cannot decode, so there is no reconstruction to show and
/// making more versions would be pointless.
bool _previewUnavailable = false;
_Version? get _current => _versions.isEmpty ? null : _versions[_selected];
/// A version is being encoded or decoded. Codec jobs run one at a time, so
/// "Try another version" waits for this to clear.
bool get _working => _versions.any((v) => v.encoding || v.decoding);
@override
void initState() {
@@ -171,7 +202,7 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
_parity = widget.initialParity;
_probeAspect();
if (widget.codec.availability == ImageCodecAvailability.ready) {
_encode();
_addVersion();
}
}
@@ -197,59 +228,56 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
} catch (_) {}
}
Future<void> _selectView(bool reconstruction) async {
setState(() => _showReconstruction = reconstruction);
final payload = _encoded;
if (!reconstruction ||
payload == null ||
_reconstruction != null ||
_reconstructing) {
return;
/// Encodes the next version, selects it, then decodes it so the user sees
/// what recipients will get.
Future<void> _addVersion() async {
final version = _Version(_versions.length);
setState(() {
_versions.add(version);
_selected = _versions.length - 1;
_showOriginal = false;
});
Uint8List? payload;
try {
payload = await widget.codec.encode(
widget.imageBytes,
kImageSendRatePoint,
variant: version.variant,
);
} catch (_) {
payload = null;
}
setState(() => _reconstructing = true);
if (!mounted) return;
setState(() {
version.encoding = false;
version.payload = payload;
version.decoding = payload != null && !_previewUnavailable;
});
if (!version.decoding) return;
Uint8List? png;
try {
png = await widget.codec.decodePreview(payload);
png = await widget.codec.decodePreview(payload!);
} catch (_) {
png = null;
}
if (!mounted) return;
setState(() {
_reconstructing = false;
_reconstruction = png;
if (png == null) {
_reconstructionUnavailable = true;
_showReconstruction = false;
version.decoding = false;
version.png = png;
if (png == null && !_versions.any((v) => v.png != null)) {
// Nothing has ever decoded here: treat the device as unable to
// preview and fall back to showing the original.
_previewUnavailable = true;
_showOriginal = true;
}
});
}
Future<Uint8List?> _encode() async {
final cached = _encoded;
if (cached != null) return cached;
void _select(int index) {
setState(() {
_encoding = true;
_failed = false;
_selected = index;
_showOriginal = false;
});
try {
final bytes = await widget.codec.encode(
widget.imageBytes,
kImageSendRatePoint,
);
if (!mounted) return bytes;
setState(() {
_encoded = bytes;
_encoding = false;
});
return bytes;
} catch (_) {
if (!mounted) return null;
setState(() {
_encoding = false;
_failed = true;
});
return null;
}
}
ImageSendRadio _radioParams(BuildContext context) {
@@ -264,7 +292,7 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
}
_RateEstimate _estimateFor(ImageSendRadio radio) {
final bytes = _encoded;
final bytes = _current?.payload;
if (bytes != null) {
final exact = _estimate(bytes.length, radio);
return _RateEstimate(
@@ -293,14 +321,11 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
);
}
Future<void> _onSend() async {
void _onSend() {
final version = _current;
final payload = version?.payload;
if (version == null || payload == null) return;
setState(() => _sending = true);
final payload = await _encode();
if (!mounted) return;
if (payload == null) {
setState(() => _sending = false);
return;
}
final radio = _radio ?? const ImageSendRadio();
final estimate = _estimate(payload.length, radio);
Navigator.of(context).pop(
@@ -311,6 +336,7 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
packetCount: estimate.chunkCount,
airtime: estimate.totalAirtime,
wallClock: estimate.pacedWallClock,
previewPng: version.png,
),
);
}
@@ -375,7 +401,7 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
..._warnings(theme, colors, radio, selected),
const SizedBox(height: 4),
_parityTile(theme, colors),
if (_failed) ...[
if (_current?.failed ?? false) ...[
const SizedBox(height: 12),
_banner(
colors: colors,
@@ -408,6 +434,9 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
),
);
/// The main preview: by default the selected version as recipients
/// will see it, with the original one tap away for comparison.
///
/// The preview is deliberately capped in height: the packet count and airtime
/// below it are the reason this screen exists and must not be pushed off the
/// first screenful by a full-width square.
@@ -419,59 +448,96 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
) {
final l10n = context.l10n;
final maxSide = MediaQuery.sizeOf(context).height * 0.28;
final reconstruction = _showReconstruction ? _reconstruction : null;
final version = _current;
final canPreview = ready && !_previewUnavailable;
final showReconstruction = canPreview && !_showOriginal && version != null;
final png = showReconstruction ? version.png : null;
final pending =
showReconstruction &&
png == null &&
(version.encoding || version.decoding);
final broken = showReconstruction && png == null && !pending;
Widget content;
if (pending) {
content = Center(
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircularProgressIndicator(),
const SizedBox(height: 12),
Text(
l10n.imageSend_preparingPreview,
textAlign: TextAlign.center,
style: theme.textTheme.bodyMedium?.copyWith(
color: colors.onSurfaceVariant,
),
),
],
),
),
);
} else if (broken) {
content = Center(
child: Icon(
Icons.broken_image_outlined,
size: 48,
color: colors.onSurfaceVariant,
),
);
} else {
content = Image.memory(
png ?? widget.imageBytes,
// The reconstruction is the stretched square; fill undoes the stretch
// into the recipient's shape.
fit: png != null ? BoxFit.fill : BoxFit.contain,
alignment: Alignment.center,
gaplessPlayback: true,
errorBuilder: (context, error, stack) => Center(
child: Icon(
Icons.broken_image_outlined,
size: 48,
color: colors.onSurfaceVariant,
),
),
);
}
return Column(
children: [
if (ready) ...[
if (canPreview) ...[
SegmentedButton<bool>(
segments: [
ButtonSegment(
value: false,
label: MeshSegmentLabel(l10n.imageSend_viewOriginal),
label: MeshSegmentLabel(l10n.imageSend_viewReconstruction),
),
ButtonSegment(
value: true,
label: MeshSegmentLabel(l10n.imageSend_viewReconstruction),
enabled: _encoded != null && !_reconstructionUnavailable,
label: MeshSegmentLabel(l10n.imageSend_viewOriginal),
),
],
selected: {_showReconstruction},
onSelectionChanged: (s) => _selectView(s.first),
selected: {_showOriginal},
onSelectionChanged: (s) => setState(() => _showOriginal = s.first),
),
const SizedBox(height: 12),
],
ConstrainedBox(
constraints: BoxConstraints(maxHeight: maxSide, maxWidth: maxSide),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(MeshRadii.md),
child: AspectRatio(
aspectRatio: reconstruction != null ? _recipientAspect : _aspect,
child: Container(
aspectRatio: showReconstruction ? _recipientAspect : _aspect,
child: ColoredBox(
color: colors.surfaceContainerHighest,
child: _showReconstruction && _reconstructing
? const Center(child: CircularProgressIndicator())
: Image.memory(
reconstruction ?? widget.imageBytes,
// The reconstruction is the stretched square; fill
// undoes the stretch into the recipient's shape.
fit: reconstruction != null
? BoxFit.fill
: BoxFit.contain,
alignment: Alignment.center,
gaplessPlayback: true,
errorBuilder: (context, error, stack) => Center(
child: Icon(
Icons.broken_image_outlined,
size: 48,
color: colors.onSurfaceVariant,
),
),
),
child: content,
),
),
),
),
if (_reconstructionUnavailable) ...[
if (_previewUnavailable) ...[
const SizedBox(height: 8),
Text(
l10n.imageSend_reconstructionUnavailable,
@@ -481,6 +547,10 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
),
),
],
if (canPreview && _versions.isNotEmpty) ...[
const SizedBox(height: 16),
_versionsRow(theme, colors),
],
const SizedBox(height: 8),
Text(
l10n.imageSend_lossyNote(
@@ -496,6 +566,152 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
);
}
/// The versions made so far, plus "Try another version".
Widget _versionsRow(ThemeData theme, ColorScheme colors) {
final l10n = context.l10n;
return Column(
children: [
Wrap(
alignment: WrapAlignment.center,
spacing: 8,
runSpacing: 8,
children: [
for (var i = 0; i < _versions.length; i++)
_versionTile(theme, colors, i),
],
),
if (_versions.length < kImageSendMaxVersions) ...[
const SizedBox(height: 12),
OutlinedButton.icon(
onPressed: (_working || _sending) ? null : _addVersion,
icon: const Icon(Icons.refresh),
label: Text(l10n.imageSend_tryAnother),
),
],
const SizedBox(height: 8),
Text(
l10n.imageSend_versionsHint,
textAlign: TextAlign.center,
style: theme.textTheme.bodySmall?.copyWith(
color: colors.onSurfaceVariant,
),
),
],
);
}
/// One selectable version: its reconstruction, "Version n" and its packet
/// count. Selection shows as a thick primary border plus a check badge, so
/// it never relies on colour alone.
Widget _versionTile(ThemeData theme, ColorScheme colors, int index) {
final l10n = context.l10n;
final version = _versions[index];
final selected = index == _selected;
final label = l10n.imageSend_versionLabel(index + 1);
const maxSide = 80.0;
final aspect = _recipientAspect;
final width = aspect >= 1 ? maxSide : maxSide * aspect;
final height = aspect >= 1 ? maxSide / aspect : maxSide;
final payload = version.payload;
final packets = payload == null
? null
: _estimate(
payload.length,
_radio ?? const ImageSendRadio(),
).chunkCount;
final Widget thumb;
if (version.png != null) {
thumb = Image.memory(
version.png!,
fit: BoxFit.fill,
gaplessPlayback: true,
);
} else if (version.encoding || version.decoding) {
thumb = const Center(
child: SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(strokeWidth: 2),
),
);
} else {
thumb = Icon(Icons.broken_image_outlined, color: colors.onSurfaceVariant);
}
return Semantics(
button: true,
selected: selected,
label: label,
excludeSemantics: true,
child: InkWell(
borderRadius: BorderRadius.circular(MeshRadii.sm),
onTap: _sending ? null : () => _select(index),
child: Padding(
padding: const EdgeInsets.all(4),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Stack(
children: [
Container(
width: width.clamp(48.0, maxSide),
height: height.clamp(48.0, maxSide),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: colors.surfaceContainerHighest,
borderRadius: BorderRadius.circular(MeshRadii.sm),
border: Border.all(
color: selected
? colors.primary
: colors.outlineVariant,
width: selected ? 3 : 1,
),
),
child: thumb,
),
if (selected)
Positioned(
top: 4,
right: 4,
child: Container(
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
color: colors.primary,
shape: BoxShape.circle,
),
child: Icon(
Icons.check,
size: 16,
color: colors.onPrimary,
),
),
),
],
),
const SizedBox(height: 4),
Text(
label,
style: theme.textTheme.bodySmall?.copyWith(
color: selected ? colors.onSurface : colors.onSurfaceVariant,
fontWeight: selected ? FontWeight.w600 : null,
),
),
if (packets != null)
Text(
l10n.imageSend_versionPackets(packets),
style: MeshTheme.mono(
fontSize: 12,
color: colors.onSurfaceVariant,
),
),
],
),
),
),
);
}
Widget _sizeRow(ThemeData theme, ColorScheme colors, _RateEstimate estimate) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -794,7 +1010,8 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
Widget _actions(ThemeData theme, bool ready) {
final localizations = context.l10n;
final busy = _sending || _encoding;
final busy = _sending || (_current?.encoding ?? false);
final canSend = ready && !_sending && _current?.payload != null;
return Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
child: Row(
@@ -810,7 +1027,7 @@ class _ImageSendPreviewSheetState extends State<ImageSendPreviewSheet> {
const SizedBox(width: 12),
Expanded(
child: FilledButton.icon(
onPressed: (!ready || busy) ? null : _onSend,
onPressed: canSend ? _onSend : null,
icon: busy
? const SizedBox(
width: 16,
+31 -11
View File
@@ -93,6 +93,7 @@ Color senderNameColor(String name) {
class MessageBubbleFrame extends StatelessWidget {
final bool isOutgoing;
final bool isFailed;
final bool isBookmarked;
/// Tighter padding for media (GIF) content.
final bool compact;
@@ -105,6 +106,7 @@ class MessageBubbleFrame extends StatelessWidget {
required this.maxWidth,
required this.child,
this.isFailed = false,
this.isBookmarked = false,
this.compact = false,
});
@@ -115,17 +117,35 @@ class MessageBubbleFrame extends StatelessWidget {
isOutgoing: isOutgoing,
isFailed: isFailed,
);
return Container(
padding: compact
? const EdgeInsets.all(4)
: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
constraints: BoxConstraints(maxWidth: maxWidth * 0.72),
decoration: BoxDecoration(
color: colors.background,
borderRadius: messageBubbleRadius(isOutgoing: isOutgoing),
border: Border.all(color: colors.border, width: 1),
),
child: child,
final contentPadding = compact
? const EdgeInsets.all(4)
: const EdgeInsets.symmetric(horizontal: 12, vertical: 8);
return Stack(
clipBehavior: Clip.none,
children: [
Container(
constraints: BoxConstraints(maxWidth: maxWidth * 0.72),
decoration: BoxDecoration(
color: colors.background,
borderRadius: messageBubbleRadius(isOutgoing: isOutgoing),
border: Border.all(color: colors.border, width: 1),
),
child: Padding(
padding: isBookmarked
? contentPadding.add(
EdgeInsets.only(top: compact ? 18 : 14, right: 14),
)
: contentPadding,
child: child,
),
),
if (isBookmarked)
const Positioned(
top: -2,
right: 12,
child: Icon(Icons.bookmark, size: 22, color: Color(0xFFFFE54A)),
),
],
);
}
}
+7 -4
View File
@@ -19,10 +19,13 @@
///
/// Both are private to this file, are not parameterised, and are reused
/// verbatim by the full-screen viewer this widget opens on tap, so there is no
/// route in the app that can show the pixels without them. The only case in
/// which they are absent is [ReceivedImageEntry.isOutgoing], where the PNG is
/// the sender's own 512x512 crop and the label would be a falsehood — that is
/// read from the store's sidecar, never from a constructor argument.
/// route in the app that can show the pixels without them. They are absent
/// only when [ReceivedImageEntry.synthesized] is false: the sender's own image
/// on a device that could not decode, where the PNG is their stretched
/// original and the label would be a falsehood. The sender's own image is
/// otherwise the decoded version they picked, so it is labelled like any
/// other. That is read from the store's sidecar, never from a constructor
/// argument.
///
/// The widget deliberately exposes no share/save action: an exported raster
/// would have to have the caption composited into it first, and that belongs