Merge remote-tracking branch 'zjs81/dev' into ez_disable_discoveredContact_eviction_PR
This commit is contained in:
commit
4480c0d356
56 files changed
+1500
-229
No files matched your search
@@ -375,12 +375,14 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
List<Channel> _cachedChannels = [];
|
||||
final Map<int, bool> _channelSmazEnabled = {};
|
||||
final Map<int, bool> _channelCyr2LatEnabled = {};
|
||||
final Map<int, bool> _channelUrlImagesEnabled = {};
|
||||
final Map<int, String?> _channelCyr2LatProfileId = {};
|
||||
final Map<int, Region> _channelRegions = {};
|
||||
bool _lastSentWasCliCommand =
|
||||
false; // Track if last sent message was a CLI command
|
||||
final Map<String, bool> _contactSmazEnabled = {};
|
||||
final Map<String, bool> _contactCyr2LatEnabled = {};
|
||||
final Map<String, bool> _contactUrlImagesEnabled = {};
|
||||
final Map<String, String?> _contactCyr2LatProfileId = {};
|
||||
final Set<String> _knownContactKeys = {};
|
||||
final Map<String, int> _contactUnreadCount = {};
|
||||
@@ -454,6 +456,13 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
);
|
||||
}
|
||||
|
||||
Contact? getContactByPubKeyHex(String contactPubKeyHex) {
|
||||
return _contacts.cast<Contact?>().firstWhere(
|
||||
(c) => c?.publicKeyHex == contactPubKeyHex,
|
||||
orElse: () => null,
|
||||
);
|
||||
}
|
||||
|
||||
List<Contact> get allContacts => List.unmodifiable([
|
||||
..._contacts,
|
||||
..._discoveredContacts.where(
|
||||
@@ -782,6 +791,15 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
return _contactSmazEnabled[contactKeyHex] ?? false;
|
||||
}
|
||||
|
||||
bool isChannelUrlImagesEnabled(int channelIndex) {
|
||||
return _channelUrlImagesEnabled[channelIndex] ?? false;
|
||||
}
|
||||
|
||||
bool isContactUrlImagesEnabled(String contactKeyHex) {
|
||||
_ensureContactUrlImagesSettingLoaded(contactKeyHex);
|
||||
return _contactUrlImagesEnabled[contactKeyHex] ?? false;
|
||||
}
|
||||
|
||||
bool hasChannelRegion(int channelIndex) {
|
||||
return (_channelRegions[channelIndex] ?? '').isNotEmpty;
|
||||
}
|
||||
@@ -924,6 +942,24 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setChannelUrlImagesEnabled(
|
||||
int channelIndex,
|
||||
bool enabled,
|
||||
) async {
|
||||
_channelUrlImagesEnabled[channelIndex] = enabled;
|
||||
await _channelSettingsStore.saveUrlImagesEnabled(channelIndex, enabled);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setContactUrlImagesEnabled(
|
||||
String contactKeyHex,
|
||||
bool enabled,
|
||||
) async {
|
||||
_contactUrlImagesEnabled[contactKeyHex] = enabled;
|
||||
await _contactSettingsStore.saveUrlImagesEnabled(contactKeyHex, enabled);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setChannelCyr2LatEnabled(int channelIndex, bool enabled) async {
|
||||
_channelCyr2LatEnabled[channelIndex] = enabled;
|
||||
if (enabled) {
|
||||
@@ -1094,6 +1130,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> loadContactCache() async {
|
||||
_contactUrlImagesEnabled.clear();
|
||||
final cached = await _contactStore.loadContacts();
|
||||
_knownContactKeys
|
||||
..clear()
|
||||
@@ -1104,6 +1141,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
for (final contact in cached) {
|
||||
_ensureContactSmazSettingLoaded(contact.publicKeyHex);
|
||||
_ensureContactCyr2LatSettingLoaded(contact.publicKeyHex);
|
||||
_ensureContactUrlImagesSettingLoaded(contact.publicKeyHex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1136,12 +1174,15 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
Future<void> loadChannelSettings({int? maxChannels}) async {
|
||||
_channelSmazEnabled.clear();
|
||||
_channelCyr2LatEnabled.clear();
|
||||
_channelUrlImagesEnabled.clear();
|
||||
_channelRegions.clear();
|
||||
final channelCount = maxChannels ?? _maxChannels;
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
_channelSmazEnabled[i] = await _channelSettingsStore.loadSmazEnabled(i);
|
||||
_channelCyr2LatEnabled[i] = await _channelSettingsStore
|
||||
.loadCyr2LatEnabled(i);
|
||||
_channelUrlImagesEnabled[i] = await _channelSettingsStore
|
||||
.loadUrlImagesEnabled(i);
|
||||
_channelRegions[i] = await _channelRegionStore.loadRegion(i);
|
||||
}
|
||||
}
|
||||
@@ -3162,9 +3203,15 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
// Check if this is a reaction - apply locally with pending status and route through retry service
|
||||
final reactionInfo = ReactionHelper.parseReaction(text);
|
||||
if (reactionInfo != null) {
|
||||
appLogger.info('Sending reaction: ${reactionInfo.identifier()}');
|
||||
_conversations.putIfAbsent(contact.publicKeyHex, () => []);
|
||||
final messages = _conversations[contact.publicKeyHex]!;
|
||||
|
||||
// No check for duplicates. If you want to do it again to resend, you can.
|
||||
final String reactionID = reactionInfo.identifier();
|
||||
_processedContactReactions.putIfAbsent(contact.publicKeyHex, () => {});
|
||||
_processedContactReactions[contact.publicKeyHex]!.add(reactionID);
|
||||
|
||||
// Apply reaction locally with pending status
|
||||
_processOutgoingContactReaction(messages, reactionInfo, contact);
|
||||
_setReactionStatus(
|
||||
@@ -3206,7 +3253,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
translatedLanguageCode: translatedLanguageCode,
|
||||
translationModelId: translationModelId,
|
||||
);
|
||||
_addMessage(contact.publicKeyHex, message);
|
||||
_addMessage(contact.publicKeyHex, message); // recipient as "sender"
|
||||
notifyListeners();
|
||||
final outboundText = prepareContactOutboundText(contact, text);
|
||||
await sendFrame(buildSendTextMsgFrame(contact.publicKey, outboundText));
|
||||
@@ -3543,11 +3590,12 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
// Check if this is a reaction - if so, process it immediately instead of adding as a message
|
||||
final reactionInfo = ReactionHelper.parseReaction(text);
|
||||
if (reactionInfo != null) {
|
||||
reactionInfo.senderName = selfName;
|
||||
// Check if we've already processed this reaction
|
||||
_processedChannelReactions.putIfAbsent(channel.index, () => {});
|
||||
final reactionIdentifier =
|
||||
'${reactionInfo.targetHash}_${reactionInfo.emoji}';
|
||||
final reactionIdentifier = reactionInfo.identifier();
|
||||
|
||||
// Maybe we should allow resending. Recipients can drop duplicates.
|
||||
if (_processedChannelReactions[channel.index]!.contains(
|
||||
reactionIdentifier,
|
||||
)) {
|
||||
@@ -3560,6 +3608,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final messages = _channelMessages[channel.index]!;
|
||||
|
||||
// Process reaction locally to update the UI immediately
|
||||
appLogger.info('Adding sent channel reaction, id: $reactionIdentifier');
|
||||
_processReaction(messages, reactionInfo);
|
||||
await _channelMessageStore.saveChannelMessages(channel.index, messages);
|
||||
|
||||
@@ -5326,6 +5375,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
await _notificationService.showMessageNotification(
|
||||
contactName: c?.name ?? 'Unknown',
|
||||
message: resolvedText,
|
||||
urlImagesEnabled:
|
||||
c != null && isContactUrlImagesEnabled(c.publicKeyHex),
|
||||
contactId: msg.senderKeyHex,
|
||||
badgeCount: getTotalUnreadCount(),
|
||||
);
|
||||
@@ -5340,6 +5391,8 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
await _notificationService.showMessageNotification(
|
||||
contactName: c?.name ?? 'Unknown Room',
|
||||
message: resolvedText,
|
||||
urlImagesEnabled:
|
||||
c != null && isContactUrlImagesEnabled(c.publicKeyHex),
|
||||
contactId: msg.senderKeyHex,
|
||||
badgeCount: getTotalUnreadCount(),
|
||||
);
|
||||
@@ -5490,6 +5543,15 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
});
|
||||
}
|
||||
|
||||
void _ensureContactUrlImagesSettingLoaded(String contactKeyHex) {
|
||||
if (_contactUrlImagesEnabled.containsKey(contactKeyHex)) return;
|
||||
_contactSettingsStore.loadUrlImagesEnabled(contactKeyHex).then((enabled) {
|
||||
if (_contactUrlImagesEnabled[contactKeyHex] == enabled) return;
|
||||
_contactUrlImagesEnabled[contactKeyHex] = enabled;
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
|
||||
void _ensureContactCyr2LatProfileLoaded(String contactKeyHex) {
|
||||
if (_contactCyr2LatProfileId.containsKey(contactKeyHex)) return;
|
||||
_contactSettingsStore.loadCyr2LatProfileId(contactKeyHex).then((profileId) {
|
||||
@@ -5644,6 +5706,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
channelName: label,
|
||||
senderName: message.senderName,
|
||||
message: resolvedText,
|
||||
urlImagesEnabled: isChannelUrlImagesEnabled(channelIndex),
|
||||
channelIndex: message.channelIndex,
|
||||
badgeCount: getTotalUnreadCount(),
|
||||
);
|
||||
@@ -6219,15 +6282,23 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
if (reactionInfo != null) {
|
||||
// Check if we've already processed this exact reaction
|
||||
_processedContactReactions.putIfAbsent(pubKeyHex, () => {});
|
||||
final reactionIdentifier =
|
||||
'${reactionInfo.targetHash}_${reactionInfo.emoji}';
|
||||
|
||||
reactionInfo.senderName = _resolveContactSenderName(message, null, false);
|
||||
final reactionIdentifier = reactionInfo.identifier();
|
||||
final isDuplicate = _processedContactReactions[pubKeyHex]!.contains(
|
||||
reactionIdentifier,
|
||||
);
|
||||
|
||||
if (!isDuplicate) {
|
||||
// New reaction - process it
|
||||
appLogger.info('Adding reaction, id: $reactionIdentifier');
|
||||
// For hashing and dup checking, we use null for sender names in
|
||||
// normal 1:1 chats. This way if we and they have different ideas
|
||||
// about what their name is, reactions still work. But for reaction
|
||||
// reports, we want to know who sent what, rather than infer it later,
|
||||
// so we'll add it to the reactionInfo before storing it.
|
||||
reactionInfo.senderName ??= message.isOutgoing
|
||||
? selfName
|
||||
: getContactByPubKeyHex(pubKeyHex)?.name ?? '???';
|
||||
_processContactReaction(messages, reactionInfo, pubKeyHex);
|
||||
_messageStore.saveMessages(pubKeyHex, messages);
|
||||
|
||||
@@ -6252,10 +6323,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
ReactionInfo reactionInfo,
|
||||
String contactPubKeyHex,
|
||||
) {
|
||||
final contact = _contacts.cast<Contact?>().firstWhere(
|
||||
(c) => c?.publicKeyHex == contactPubKeyHex,
|
||||
orElse: () => null,
|
||||
);
|
||||
final contact = getContactByPubKeyHex(contactPubKeyHex);
|
||||
final isRoomServer = contact?.type == advTypeRoom;
|
||||
|
||||
ReactionHelper.applyReaction<Message>(
|
||||
@@ -6304,10 +6372,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
) {
|
||||
final messages = _conversations[pubKeyHex];
|
||||
if (messages == null) return;
|
||||
final contact = _contacts.cast<Contact?>().firstWhere(
|
||||
(c) => c?.publicKeyHex == pubKeyHex,
|
||||
orElse: () => null,
|
||||
);
|
||||
final contact = getContactByPubKeyHex(pubKeyHex);
|
||||
final isRoomServer = contact?.type == advTypeRoom;
|
||||
for (int i = messages.length - 1; i >= 0; i--) {
|
||||
final msg = messages[i];
|
||||
@@ -6466,12 +6531,11 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
final messages = _channelMessages[channelIndex]!;
|
||||
|
||||
// Parse reaction info
|
||||
final reactionInfo = ChannelMessage.parseReaction(message.text);
|
||||
final reactionInfo = message.parseReaction();
|
||||
if (reactionInfo != null) {
|
||||
// Check if we've already processed this exact reaction
|
||||
_processedChannelReactions.putIfAbsent(channelIndex, () => {});
|
||||
final reactionIdentifier =
|
||||
'${reactionInfo.targetHash}_${reactionInfo.emoji}';
|
||||
final reactionIdentifier = reactionInfo.identifier();
|
||||
|
||||
final isDuplicate = _processedChannelReactions[channelIndex]!.contains(
|
||||
reactionIdentifier,
|
||||
@@ -6479,6 +6543,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
|
||||
if (!isDuplicate) {
|
||||
// New reaction - process it
|
||||
appLogger.info('Adding channel reaction, id: $reactionIdentifier');
|
||||
_processReaction(messages, reactionInfo);
|
||||
// Save updated messages
|
||||
_channelMessageStore.saveChannelMessages(channelIndex, messages);
|
||||
|
||||
@@ -0,0 +1,338 @@
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
/// Finds and renders image URLs embedded in ordinary text messages.
|
||||
///
|
||||
/// This is deliberately separate from MeshCore's transmitted channel-image
|
||||
/// protocol, which is handled by [ReceivedImageStore].
|
||||
class MessageUrlImageHelper {
|
||||
static final Map<String, Future<bool>> _verifiedImageCache =
|
||||
<String, Future<bool>>{};
|
||||
static const int _maxMessageImageCacheEntries = 200;
|
||||
static final LinkedHashMap<String, Future<String?>> _messageImageCache =
|
||||
LinkedHashMap<String, Future<String?>>();
|
||||
|
||||
static final RegExp _pyxPattern = RegExp(
|
||||
r'''https?://pyx\.li/\?i=([^\s<>'"`]+)''',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
static final RegExp _ipfsUrlPattern = RegExp(
|
||||
r'''https?://[^\s<>'"`]+/(?:ipfs|ipns)/[^\s<>'"`]+''',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
static final RegExp _ipfsCidPattern = RegExp(
|
||||
r'''ipfs:(?://)?([^\s<>'"`]+)''',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
static final RegExp _ibbSharePattern = RegExp(
|
||||
r'''https?://(?:www\.)?ibb\.co/[^\s<>'"`/?#]+(?:[/?#][^\s<>'"`]*)?''',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
static final RegExp _imagePattern = RegExp(
|
||||
r'''https?://[^\s<>'"`]+?\.(?:png|jpe?g|webp)(?:\?[^\s<>'"`]+)?(?:#[^\s<>'"`]+)?''',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
/// Checks locally whether [text] contains a URL format this helper supports.
|
||||
/// This deliberately does not resolve sharing pages or fetch image data.
|
||||
static bool hasPotentialImageUrl(String text) {
|
||||
return _pyxPattern.hasMatch(text) ||
|
||||
_ipfsUrlPattern.hasMatch(text) ||
|
||||
_ipfsCidPattern.hasMatch(text) ||
|
||||
_ibbSharePattern.hasMatch(text) ||
|
||||
_imagePattern.hasMatch(text);
|
||||
}
|
||||
|
||||
static Future<String?> parse(String text) async {
|
||||
final trimmed = text.trim();
|
||||
if (trimmed.isEmpty) return null;
|
||||
|
||||
final pyxMatch = _pyxPattern.firstMatch(trimmed);
|
||||
if (pyxMatch != null) {
|
||||
return _extractFromUrl(
|
||||
_trimBoundary(pyxMatch.group(0)!),
|
||||
RegExp(r'''<img[^>]+src=["']([^"']+)["']''', caseSensitive: false),
|
||||
);
|
||||
}
|
||||
|
||||
final ipfsUrlMatch = _ipfsUrlPattern.firstMatch(trimmed);
|
||||
if (ipfsUrlMatch != null) {
|
||||
return _trimBoundary(ipfsUrlMatch.group(0)!);
|
||||
}
|
||||
|
||||
final ipfsCidMatch = _ipfsCidPattern.firstMatch(trimmed);
|
||||
if (ipfsCidMatch != null) {
|
||||
final cid = _trimBoundary(ipfsCidMatch.group(1)!);
|
||||
return 'https://ipfs.io/ipfs/$cid';
|
||||
}
|
||||
|
||||
final ibbMatch = _ibbSharePattern.firstMatch(trimmed);
|
||||
if (ibbMatch != null) {
|
||||
return _extractFromUrl(
|
||||
_trimBoundary(ibbMatch.group(0)!),
|
||||
RegExp(
|
||||
r'''<meta[^>]+property=["']og:image["'][^>]+content=["']([^"']+)["']''',
|
||||
caseSensitive: false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final imageMatch = _imagePattern.firstMatch(trimmed);
|
||||
if (imageMatch != null) {
|
||||
return _trimBoundary(imageMatch.group(0)!);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static Future<String?> parseVerified(String text) async {
|
||||
final imageUrl = await parse(text);
|
||||
if (imageUrl == null) return null;
|
||||
|
||||
final verified = await _verifyImageUrl(imageUrl);
|
||||
return verified ? imageUrl : null;
|
||||
}
|
||||
|
||||
/// Caches successful URL-image parsing by stable message identity.
|
||||
///
|
||||
/// Null results are evicted so temporary connectivity or host failures can
|
||||
/// be retried when a message is shown again.
|
||||
static Future<String?> parseVerifiedForMessage(
|
||||
String messageId,
|
||||
String text,
|
||||
) {
|
||||
final cached = _messageImageCache.remove(messageId);
|
||||
if (cached != null) {
|
||||
_messageImageCache[messageId] = cached;
|
||||
return cached;
|
||||
}
|
||||
|
||||
final parsing = parseVerified(text);
|
||||
_messageImageCache[messageId] = parsing;
|
||||
parsing.then((imageUrl) {
|
||||
if (imageUrl == null &&
|
||||
identical(_messageImageCache[messageId], parsing)) {
|
||||
_messageImageCache.remove(messageId);
|
||||
} else if (imageUrl != null) {
|
||||
while (_messageImageCache.length > _maxMessageImageCacheEntries) {
|
||||
_messageImageCache.remove(_messageImageCache.keys.first);
|
||||
}
|
||||
}
|
||||
});
|
||||
return parsing;
|
||||
}
|
||||
|
||||
static Future<String?> _extractFromUrl(String pageUrl, RegExp pattern) async {
|
||||
try {
|
||||
final response = await http
|
||||
.get(Uri.parse(pageUrl))
|
||||
.timeout(const Duration(seconds: 8));
|
||||
if (response.statusCode < 200 || response.statusCode >= 300) {
|
||||
return null;
|
||||
}
|
||||
final value = pattern.firstMatch(response.body)?.group(1);
|
||||
if (value == null || value.isEmpty) return null;
|
||||
|
||||
final imageUrl = Uri.parse(
|
||||
pageUrl,
|
||||
).resolve(value.replaceAll('&', '&'));
|
||||
return imageUrl.scheme == 'http' || imageUrl.scheme == 'https'
|
||||
? imageUrl.toString()
|
||||
: null;
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static String _trimBoundary(String value) {
|
||||
return value.trim().replaceAll(RegExp(r"[.,;:!?]+$"), '');
|
||||
}
|
||||
|
||||
static Future<bool> _verifyImageUrl(String imageUrl) {
|
||||
final cached = _verifiedImageCache[imageUrl];
|
||||
if (cached != null) return cached;
|
||||
|
||||
final verification = _tryLoadImage(imageUrl);
|
||||
_verifiedImageCache[imageUrl] = verification;
|
||||
verification.then((verified) {
|
||||
if (!verified && identical(_verifiedImageCache[imageUrl], verification)) {
|
||||
_verifiedImageCache.remove(imageUrl);
|
||||
}
|
||||
});
|
||||
return verification;
|
||||
}
|
||||
|
||||
static Future<bool> _tryLoadImage(String imageUrl) async {
|
||||
final completer = Completer<bool>();
|
||||
final stream = CachedNetworkImageProvider(
|
||||
imageUrl,
|
||||
).resolve(const ImageConfiguration());
|
||||
|
||||
late final ImageStreamListener listener;
|
||||
listener = ImageStreamListener(
|
||||
(_, _) {
|
||||
if (!completer.isCompleted) completer.complete(true);
|
||||
stream.removeListener(listener);
|
||||
},
|
||||
onError: (_, _) {
|
||||
if (!completer.isCompleted) completer.complete(false);
|
||||
stream.removeListener(listener);
|
||||
},
|
||||
);
|
||||
|
||||
stream.addListener(listener);
|
||||
|
||||
return completer.future.timeout(
|
||||
const Duration(seconds: 8),
|
||||
onTimeout: () {
|
||||
stream.removeListener(listener);
|
||||
return false;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MessageUrlImageFutureBuilder extends StatefulWidget {
|
||||
const MessageUrlImageFutureBuilder({
|
||||
super.key,
|
||||
required this.messageId,
|
||||
required this.text,
|
||||
required this.builder,
|
||||
});
|
||||
|
||||
final String messageId;
|
||||
final String text;
|
||||
final AsyncWidgetBuilder<String?> builder;
|
||||
|
||||
@override
|
||||
State<MessageUrlImageFutureBuilder> createState() =>
|
||||
_MessageUrlImageFutureBuilderState();
|
||||
}
|
||||
|
||||
class _MessageUrlImageFutureBuilderState
|
||||
extends State<MessageUrlImageFutureBuilder> {
|
||||
late Future<String?> _imageFuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_imageFuture = MessageUrlImageHelper.parseVerifiedForMessage(
|
||||
widget.messageId,
|
||||
widget.text,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant MessageUrlImageFutureBuilder oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.messageId != widget.messageId) {
|
||||
_imageFuture = MessageUrlImageHelper.parseVerifiedForMessage(
|
||||
widget.messageId,
|
||||
widget.text,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder<String?>(
|
||||
future: _imageFuture,
|
||||
builder: widget.builder,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MessageUrlImagePreview extends StatelessWidget {
|
||||
const MessageUrlImagePreview({super.key, required this.imageUrl});
|
||||
|
||||
final String imageUrl;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => Dialog(
|
||||
insetPadding: const EdgeInsets.all(12),
|
||||
backgroundColor: Colors.black,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: InteractiveViewer(
|
||||
boundaryMargin: const EdgeInsets.all(80),
|
||||
minScale: 1.0,
|
||||
maxScale: 3.0,
|
||||
child: Center(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
fit: BoxFit.contain,
|
||||
placeholder: (context, url) => const Center(
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
errorWidget: (context, url, error) => const Center(
|
||||
child: Icon(
|
||||
Icons.broken_image,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 12,
|
||||
right: 12,
|
||||
child: IconButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
icon: const Icon(Icons.close, color: Colors.white),
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: Colors.black54,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: SizedBox(
|
||||
width: 240,
|
||||
height: 240,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
fit: BoxFit.contain,
|
||||
placeholder: (context, url) => ColoredBox(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
child: Text(
|
||||
'Unable to load image',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,17 @@ import '../widgets/emoji_picker.dart';
|
||||
class ReactionInfo {
|
||||
final String targetHash;
|
||||
final String emoji;
|
||||
String? senderName;
|
||||
|
||||
ReactionInfo({required this.targetHash, required this.emoji});
|
||||
ReactionInfo({
|
||||
required this.targetHash,
|
||||
required this.emoji,
|
||||
this.senderName,
|
||||
});
|
||||
|
||||
String identifier() {
|
||||
return '$targetHash:$emoji:${senderName ?? ""}';
|
||||
}
|
||||
}
|
||||
|
||||
class ReactionHelper {
|
||||
@@ -26,9 +35,8 @@ class ReactionHelper {
|
||||
required int Function(T) getTimestampSecs,
|
||||
required String? Function(T) getSenderName,
|
||||
required String Function(T) getMessageText,
|
||||
required Map<String, int> Function(T) getReactions,
|
||||
required Map<String, List<String?>> Function(T) getReactions,
|
||||
required bool Function(T) shouldSkip,
|
||||
required void Function(int index, Map<String, int> newReactions)
|
||||
updateMessage,
|
||||
}) {
|
||||
final targetHash = reactionInfo.targetHash;
|
||||
@@ -42,9 +50,12 @@ class ReactionHelper {
|
||||
getMessageText(msg),
|
||||
);
|
||||
if (msgHash == targetHash) {
|
||||
final currentReactions = Map<String, int>.from(getReactions(msg));
|
||||
currentReactions[reactionInfo.emoji] =
|
||||
(currentReactions[reactionInfo.emoji] ?? 0) + 1;
|
||||
final currentReactions = Map<String, List<String?>>.from(
|
||||
getReactions(msg),
|
||||
);
|
||||
(currentReactions[reactionInfo.emoji] ??= []).add(
|
||||
reactionInfo.senderName,
|
||||
);
|
||||
updateMessage(i, currentReactions);
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Изберете действие за изпращане",
|
||||
"chat_sendGif": "Изпрати GIF",
|
||||
"chat_reply": "Отговори",
|
||||
"chat_addReaction": "Добави Реакция",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Регион: ние",
|
||||
"channels_regionSelect_Title": "Выберете регион",
|
||||
"channels_clearRegion": "Чиста зона",
|
||||
"chat_sendImage": "Изпрати изображение",
|
||||
"chat_sendImageLora": "Изпращане на изображение чрез MeshCore",
|
||||
"chat_imagePickFailed": "Не мог да откривам та изображин",
|
||||
"chat_receivedGif": "Получил GIF",
|
||||
"repeater_keySettings": "Изменяне на идентичности ключа",
|
||||
|
||||
+4
-1
@@ -507,6 +507,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Sendeaktion auswählen",
|
||||
"chat_sendGif": "GIF senden",
|
||||
"chat_reply": "Antworten",
|
||||
"chat_addReaction": "Reaktion hinzufügen",
|
||||
@@ -2627,6 +2628,8 @@
|
||||
"messageStatus_pending": "Wird gesendet",
|
||||
"messageStatus_failed": "Senden fehlgeschlagen",
|
||||
"messageStatus_repeated": "Mehrfach gehört",
|
||||
"urlImage_enable": "URL-Bilder anzeigen",
|
||||
"urlImage_possible": "Mögliches URL-Bild; in den Einstellungen aktivieren.",
|
||||
"contacts_moreOptions": "Weitere Optionen",
|
||||
"contacts_searchOpen": "Suche öffnen",
|
||||
"contacts_searchClose": "Suche schließen",
|
||||
@@ -2892,7 +2895,7 @@
|
||||
"repeater_pathHashModeOption2": "2 - 3 Bytes",
|
||||
"repeater_pathHashModeOption3": "3 - 4 Bytes",
|
||||
"appSettings_batteryLipoHv": "LiPo HV (3,0–4,35 V)",
|
||||
"chat_sendImage": "Bild senden",
|
||||
"chat_sendImageLora": "Bild über MeshCore senden",
|
||||
"chat_imagePickFailed": "Konnte dieses Bild nicht öffnen.",
|
||||
"chat_receivedGif": "Erhalten eines GIF",
|
||||
"repeater_keySettings": "Identitätsschlüssel ändern",
|
||||
|
||||
+5
-1
@@ -34,6 +34,8 @@
|
||||
"messageStatus_pending": "Sending",
|
||||
"messageStatus_failed": "Failed to send",
|
||||
"messageStatus_repeated": "Heard repeated",
|
||||
"urlImage_enable": "Enable URL images",
|
||||
"urlImage_possible": "Possible URL image; enable it in Settings.",
|
||||
"common_reboot": "Reboot",
|
||||
"common_loading": "Loading...",
|
||||
"common_notAvailable": "—",
|
||||
@@ -740,8 +742,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Select send action",
|
||||
"chat_sendGif": "Send GIF",
|
||||
"chat_sendImage": "Send image",
|
||||
"chat_sendImageLora": "Send image via meshcore",
|
||||
"chat_imagePickFailed": "Couldn't open that image",
|
||||
"@chat_imagePickFailed": {
|
||||
"description": "Shown when picking or reading a photo to send fails"
|
||||
@@ -750,6 +753,7 @@
|
||||
"chat_reply": "Reply",
|
||||
"chat_addReaction": "Add Reaction",
|
||||
"chat_me": "Me",
|
||||
"reaction_report": "Emoji Reactions",
|
||||
"emojiCategorySmileys": "Smileys",
|
||||
"emojiCategoryGestures": "Gestures",
|
||||
"emojiCategoryHearts": "Hearts",
|
||||
|
||||
+2
-1
@@ -507,6 +507,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Seleccionar acción de envío",
|
||||
"chat_sendGif": "Enviar GIF",
|
||||
"chat_reply": "Responder",
|
||||
"chat_addReaction": "Añadir Reacción",
|
||||
@@ -2890,7 +2891,7 @@
|
||||
"channels_regionNotSet": "Región: ninguna",
|
||||
"channels_regionSelect_Title": "Seleccione una región",
|
||||
"channels_clearRegion": "Zona despejada",
|
||||
"chat_sendImage": "Enviar imagen",
|
||||
"chat_sendImageLora": "Enviar imagen mediante MeshCore",
|
||||
"chat_imagePickFailed": "No pude abrir esa imagen",
|
||||
"chat_receivedGif": "Recibido un GIF",
|
||||
"repeater_keySettings": "Cambiar Claves de Identidad",
|
||||
|
||||
+2
-1
@@ -507,6 +507,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Sélectionner une action d’envoi",
|
||||
"chat_sendGif": "Envoyer un GIF",
|
||||
"chat_reply": "Répondre",
|
||||
"chat_addReaction": "Ajouter une réaction",
|
||||
@@ -2890,7 +2891,7 @@
|
||||
"channels_regionNotSet": "Région : aucune",
|
||||
"channels_regionSelect_Title": "Choisissez une région",
|
||||
"channels_clearRegion": "Zone dégagée",
|
||||
"chat_sendImage": "Envoyer l'image",
|
||||
"chat_sendImageLora": "Envoyer une image via MeshCore",
|
||||
"chat_imagePickFailed": "Je n'ai pas pu ouvrir cette image",
|
||||
"chat_receivedGif": "Reçu un GIF",
|
||||
"repeater_keySettings": "Modifier les clés d'identité",
|
||||
|
||||
+2
-1
@@ -657,6 +657,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Küldési művelet kiválasztása",
|
||||
"chat_sendGif": "GIF küldése",
|
||||
"chat_reply": "Válasz",
|
||||
"chat_addReaction": "Reakció hozzáadása",
|
||||
@@ -2794,7 +2795,7 @@
|
||||
"channels_regionNotSet": "Tájékoztetés: nem",
|
||||
"channels_regionSelect_Title": "Válassz egy regionot",
|
||||
"channels_clearRegion": "Kéres kör",
|
||||
"chat_sendImage": "Felhasználj az image",
|
||||
"chat_sendImageLora": "Kép küldése MeshCore-on keresztül",
|
||||
"chat_imagePickFailed": "Nem tudtam ezt a fenti fényre kapni",
|
||||
"chat_receivedGif": "GIF-ot kapott",
|
||||
"repeater_keySettings": "Képzőítsekei jelölt",
|
||||
|
||||
+2
-1
@@ -551,6 +551,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Seleziona azione di invio",
|
||||
"chat_sendGif": "Invia GIF",
|
||||
"chat_reply": "Rispondi",
|
||||
"chat_addReaction": "Aggiungi Reazione",
|
||||
@@ -2890,7 +2891,7 @@
|
||||
"channels_regionNotSet": "Regione: nessuna",
|
||||
"channels_regionSelect_Title": "Scegli una regione",
|
||||
"channels_clearRegion": "Zona chiara",
|
||||
"chat_sendImage": "Invia immagine",
|
||||
"chat_sendImageLora": "Invia immagine tramite MeshCore",
|
||||
"chat_imagePickFailed": "Non sono riuscito ad aprire quell'immagine",
|
||||
"chat_receivedGif": "Ricevuto un GIF",
|
||||
"repeater_keySettings": "Cambia le Chiavi di Identità",
|
||||
|
||||
+2
-1
@@ -675,6 +675,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "送信アクションを選択",
|
||||
"chat_sendGif": "GIF を送信",
|
||||
"chat_reply": "返信",
|
||||
"chat_addReaction": "リアクションを追加",
|
||||
@@ -2890,7 +2891,7 @@
|
||||
"channels_regionNotSet": "地域:なし",
|
||||
"channels_regionSelect_Title": "地域を選択する",
|
||||
"channels_clearRegion": "クリアな地域",
|
||||
"chat_sendImage": "画像を送信",
|
||||
"chat_sendImageLora": "MeshCore経由で画像を送信",
|
||||
"chat_imagePickFailed": "その画像を開けませんでした",
|
||||
"chat_receivedGif": "GIFを受け取りました",
|
||||
"repeater_keySettings": "アイデンティティキーの変更",
|
||||
|
||||
+2
-1
@@ -657,6 +657,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "전송 작업 선택",
|
||||
"chat_sendGif": "GIF 보내기",
|
||||
"chat_reply": "답변",
|
||||
"chat_addReaction": "댓글 추가",
|
||||
@@ -2890,7 +2891,7 @@
|
||||
"channels_regionNotSet": "지역: 없음",
|
||||
"channels_regionSelect_Title": "지역을 선택하세요",
|
||||
"channels_clearRegion": "명확한 지역",
|
||||
"chat_sendImage": "이미지를 보내세요",
|
||||
"chat_sendImageLora": "MeshCore를 통해 이미지 보내기",
|
||||
"chat_imagePickFailed": "그 이미지를 열 수 없었어요.",
|
||||
"chat_receivedGif": "GIF를 받았습니다",
|
||||
"repeater_keySettings": "신원 키 변경",
|
||||
|
||||
@@ -334,6 +334,18 @@ abstract class AppLocalizations {
|
||||
/// **'Heard repeated'**
|
||||
String get messageStatus_repeated;
|
||||
|
||||
/// No description provided for @urlImage_enable.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enable URL images'**
|
||||
String get urlImage_enable;
|
||||
|
||||
/// No description provided for @urlImage_possible.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Possible URL image; enable it in Settings.'**
|
||||
String get urlImage_possible;
|
||||
|
||||
/// No description provided for @common_reboot.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -2728,17 +2740,23 @@ abstract class AppLocalizations {
|
||||
/// **'Retry {current}/{max}'**
|
||||
String chat_retryCount(int current, int max);
|
||||
|
||||
/// No description provided for @chat_selectSendAction.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Select send action'**
|
||||
String get chat_selectSendAction;
|
||||
|
||||
/// No description provided for @chat_sendGif.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Send GIF'**
|
||||
String get chat_sendGif;
|
||||
|
||||
/// No description provided for @chat_sendImage.
|
||||
/// No description provided for @chat_sendImageLora.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Send image'**
|
||||
String get chat_sendImage;
|
||||
/// **'Send image via meshcore'**
|
||||
String get chat_sendImageLora;
|
||||
|
||||
/// Shown when picking or reading a photo to send fails
|
||||
///
|
||||
@@ -2770,6 +2788,12 @@ abstract class AppLocalizations {
|
||||
/// **'Me'**
|
||||
String get chat_me;
|
||||
|
||||
/// No description provided for @reaction_report.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Emoji Reactions'**
|
||||
String get reaction_report;
|
||||
|
||||
/// No description provided for @emojiCategorySmileys.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Повторно чуто';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Рестартирай';
|
||||
|
||||
@@ -1489,11 +1495,14 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
return 'Опитай отново $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Изберете действие за изпращане';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Изпрати GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Изпрати изображение';
|
||||
String get chat_sendImageLora => 'Изпращане на изображение чрез MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Не мог да откривам та изображин';
|
||||
@@ -1510,6 +1519,9 @@ class AppLocalizationsBg extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Аз';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Емотикони';
|
||||
|
||||
|
||||
@@ -110,6 +110,13 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Mehrfach gehört';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'URL-Bilder anzeigen';
|
||||
|
||||
@override
|
||||
String get urlImage_possible =>
|
||||
'Mögliches URL-Bild; in den Einstellungen aktivieren.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Neustart';
|
||||
|
||||
@@ -1488,11 +1495,14 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
return 'Wiederholen $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Sendeaktion auswählen';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'GIF senden';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Bild senden';
|
||||
String get chat_sendImageLora => 'Bild über MeshCore senden';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Konnte dieses Bild nicht öffnen.';
|
||||
@@ -1509,6 +1519,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Ich';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoticons';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Heard repeated';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Reboot';
|
||||
|
||||
@@ -1456,11 +1462,14 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
return 'Retry $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Select send action';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Send GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Send image';
|
||||
String get chat_sendImageLora => 'Send image via meshcore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Couldn\'t open that image';
|
||||
@@ -1477,6 +1486,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Me';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Smileys';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Escuchado repetidamente';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Reiniciar';
|
||||
|
||||
@@ -1484,11 +1490,14 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
return 'Reintentar $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Seleccionar acción de envío';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Enviar GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Enviar imagen';
|
||||
String get chat_sendImageLora => 'Enviar imagen mediante MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'No pude abrir esa imagen';
|
||||
@@ -1505,6 +1514,9 @@ class AppLocalizationsEs extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Yo';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoticones';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Reçu plusieurs fois';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Redémarrer';
|
||||
|
||||
@@ -1487,11 +1493,14 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
return 'Essai $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Sélectionner une action d’envoi';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Envoyer un GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Envoyer l\'image';
|
||||
String get chat_sendImageLora => 'Envoyer une image via MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Je n\'ai pas pu ouvrir cette image';
|
||||
@@ -1508,6 +1517,9 @@ class AppLocalizationsFr extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Moi';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Émojis';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => '– ismételte Heard';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Indítsa újra';
|
||||
|
||||
@@ -1479,11 +1485,14 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
return 'Próbálja újra $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Küldési művelet kiválasztása';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'GIF küldése';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Felhasználj az image';
|
||||
String get chat_sendImageLora => 'Kép küldése MeshCore-on keresztül';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Nem tudtam ezt a fenti fényre kapni';
|
||||
@@ -1500,6 +1509,9 @@ class AppLocalizationsHu extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Nekem';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Hangulatjelek';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Ricevuto ripetutamente';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Riavvia';
|
||||
|
||||
@@ -1487,11 +1493,14 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
return 'Riprova $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Seleziona azione di invio';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Invia GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Invia immagine';
|
||||
String get chat_sendImageLora => 'Invia immagine tramite MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed =>
|
||||
@@ -1509,6 +1518,9 @@ class AppLocalizationsIt extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Io';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoji';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => '何度も聞いた';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => '再起動';
|
||||
|
||||
@@ -1412,11 +1418,14 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
return '$current/$max 回目';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => '送信アクションを選択';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'GIF を送信';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => '画像を送信';
|
||||
String get chat_sendImageLora => 'MeshCore経由で画像を送信';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'その画像を開けませんでした';
|
||||
@@ -1433,6 +1442,9 @@ class AppLocalizationsJa extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => '私';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => '顔文字';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => '반복 수신됨';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => '재부팅';
|
||||
|
||||
@@ -1415,11 +1421,14 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
return '$current/$max 시도';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => '전송 작업 선택';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'GIF 보내기';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => '이미지를 보내세요';
|
||||
String get chat_sendImageLora => 'MeshCore를 통해 이미지 보내기';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => '그 이미지를 열 수 없었어요.';
|
||||
@@ -1436,6 +1445,9 @@ class AppLocalizationsKo extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => '나';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => '이모티콘';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Hearsay, herhaald';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Herstarten';
|
||||
|
||||
@@ -1474,11 +1480,14 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
return 'Poging opnieuw $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Verzendactie selecteren';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'GIF verzenden';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Beeld verzenden';
|
||||
String get chat_sendImageLora => 'Afbeelding verzenden via MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Kunde die afbeelding niet openen';
|
||||
@@ -1495,6 +1504,9 @@ class AppLocalizationsNl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Mijn';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoji\'s';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Usłyszałem to wielokrotnie';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Uruchom ponownie';
|
||||
|
||||
@@ -1497,11 +1503,14 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
return 'Próba $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Wybierz czynność wysyłania';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Wyślij GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Wyślij obraz';
|
||||
String get chat_sendImageLora => 'Wyślij obraz przez MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Nie mogłem otworzyć tego obrazu';
|
||||
@@ -1518,6 +1527,9 @@ class AppLocalizationsPl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Ja';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoji';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Ouvi repetidamente';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Reiniciar';
|
||||
|
||||
@@ -1483,11 +1489,14 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
return 'Tentar $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Selecionar ação de envio';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Enviar GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Enviar imagem';
|
||||
String get chat_sendImageLora => 'Enviar imagem via MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Não consegui abrir essa imagem';
|
||||
@@ -1504,6 +1513,9 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Eu';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emojis';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Услышал несколько раз';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Перезагрузить';
|
||||
|
||||
@@ -1487,11 +1493,14 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
return 'Попытка $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Выберите действие отправки';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Отправить GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Отправьте изображение';
|
||||
String get chat_sendImageLora => 'Отправить изображение через MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Не удалось открыть это изображение';
|
||||
@@ -1508,6 +1517,9 @@ class AppLocalizationsRu extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Я';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Смайлы';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Slyšal som to opakovane';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Restartovať';
|
||||
|
||||
@@ -1472,11 +1478,14 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
return 'Skúsiť $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Vybrať akciu odoslania';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Odoslať GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Vyslat obraz';
|
||||
String get chat_sendImageLora => 'Odoslať obrázok cez MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Nesmiela jsem otvoriť tento obrázok';
|
||||
@@ -1493,6 +1502,9 @@ class AppLocalizationsSk extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Mne';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoji';
|
||||
|
||||
|
||||
@@ -111,6 +111,12 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Slišal sem večkrat';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Ponoviti';
|
||||
|
||||
@@ -1472,11 +1478,14 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
return 'Ponovit $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Izberite dejanje pošiljanja';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Pošlji GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Sločaji slik';
|
||||
String get chat_sendImageLora => 'Pošlji sliko prek MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Nispeval sem tega ta slik';
|
||||
@@ -1493,6 +1502,9 @@ class AppLocalizationsSl extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'jaz';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emoji';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Hördes upprepade gånger';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Start om';
|
||||
|
||||
@@ -1464,11 +1470,14 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
return 'Försök igen $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Välj sändningsåtgärd';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Skicka GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => 'Send vagnbild';
|
||||
String get chat_sendImageLora => 'Skicka bild via MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Kunde inte öppna det bildet';
|
||||
@@ -1485,6 +1494,9 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Mig';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Emojis';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => 'Почув неодноразово';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => 'Перезавантажити';
|
||||
|
||||
@@ -1477,12 +1483,14 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
return 'Повторна спроба $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => 'Виберіть дію надсилання';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => 'Надіслати GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage =>
|
||||
'Нашкоду зовні\n\n(or more naturally, depending on context)\n\nПошукуєте изображення';
|
||||
String get chat_sendImageLora => 'Надіслати зображення через MeshCore';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => 'Неможливо відкрити це изображення';
|
||||
@@ -1499,6 +1507,9 @@ class AppLocalizationsUk extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => 'Я';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => 'Емодзі';
|
||||
|
||||
|
||||
@@ -110,6 +110,12 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get messageStatus_repeated => '多次听到';
|
||||
|
||||
@override
|
||||
String get urlImage_enable => 'Enable URL images';
|
||||
|
||||
@override
|
||||
String get urlImage_possible => 'Possible URL image; enable it in Settings.';
|
||||
|
||||
@override
|
||||
String get common_reboot => '重启';
|
||||
|
||||
@@ -1398,11 +1404,14 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
return '重试 $current/$max';
|
||||
}
|
||||
|
||||
@override
|
||||
String get chat_selectSendAction => '选择发送操作';
|
||||
|
||||
@override
|
||||
String get chat_sendGif => '发送 GIF';
|
||||
|
||||
@override
|
||||
String get chat_sendImage => '发送图片';
|
||||
String get chat_sendImageLora => '通过 MeshCore 发送图片';
|
||||
|
||||
@override
|
||||
String get chat_imagePickFailed => '无法打开该图片';
|
||||
@@ -1419,6 +1428,9 @@ class AppLocalizationsZh extends AppLocalizations {
|
||||
@override
|
||||
String get chat_me => '我';
|
||||
|
||||
@override
|
||||
String get reaction_report => 'Emoji Reactions';
|
||||
|
||||
@override
|
||||
String get emojiCategorySmileys => '表情';
|
||||
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Verzendactie selecteren",
|
||||
"chat_sendGif": "GIF verzenden",
|
||||
"chat_reply": "Reageren",
|
||||
"chat_addReaction": "Reactie toevoegen",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Regio: geen",
|
||||
"channels_regionSelect_Title": "Kies een regio",
|
||||
"channels_clearRegion": "Duidelijke regio",
|
||||
"chat_sendImage": "Beeld verzenden",
|
||||
"chat_sendImageLora": "Afbeelding verzenden via MeshCore",
|
||||
"chat_imagePickFailed": "Kunde die afbeelding niet openen",
|
||||
"chat_receivedGif": "Ontvangen van een GIF",
|
||||
"repeater_keySettings": "Verander de Identiteitskies",
|
||||
|
||||
+2
-1
@@ -495,6 +495,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Wybierz czynność wysyłania",
|
||||
"chat_sendGif": "Wyślij GIF",
|
||||
"chat_reply": "Odpowiedz",
|
||||
"chat_addReaction": "Dodaj Reakcję",
|
||||
@@ -2794,7 +2795,7 @@
|
||||
"channels_regionNotSet": "Region: brak",
|
||||
"channels_regionSelect_Title": "Wybierz region",
|
||||
"channels_clearRegion": "Przejrzyste obszar",
|
||||
"chat_sendImage": "Wyślij obraz",
|
||||
"chat_sendImageLora": "Wyślij obraz przez MeshCore",
|
||||
"chat_imagePickFailed": "Nie mogłem otworzyć tego obrazu",
|
||||
"chat_receivedGif": "Otrzymano GIF",
|
||||
"repeater_keySettings": "Zmiana kluczy tożsamości",
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Selecionar ação de envio",
|
||||
"chat_sendGif": "Enviar GIF",
|
||||
"chat_reply": "Responder",
|
||||
"chat_addReaction": "Adicionar Reação",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Região: nenhuma",
|
||||
"channels_regionSelect_Title": "Escolha uma região",
|
||||
"channels_clearRegion": "Região desimpedida",
|
||||
"chat_sendImage": "Enviar imagem",
|
||||
"chat_sendImageLora": "Enviar imagem via MeshCore",
|
||||
"chat_imagePickFailed": "Não consegui abrir essa imagem",
|
||||
"chat_receivedGif": "Recebi um GIF",
|
||||
"repeater_keySettings": "Alterar Chaves de Identidade",
|
||||
|
||||
+2
-1
@@ -316,6 +316,7 @@
|
||||
"chat_messageDeleted": "Сообщение удалено",
|
||||
"chat_retryingMessage": "Повтор отправки сообщения",
|
||||
"chat_retryCount": "Попытка {current}/{max}",
|
||||
"chat_selectSendAction": "Выберите действие отправки",
|
||||
"chat_sendGif": "Отправить GIF",
|
||||
"chat_reply": "Ответить",
|
||||
"chat_addReaction": "Добавить реакцию",
|
||||
@@ -2059,7 +2060,7 @@
|
||||
"channels_regionNotSet": "Регион: отсутствует",
|
||||
"channels_regionSelect_Title": "Выберите регион",
|
||||
"channels_clearRegion": "Чистый регион",
|
||||
"chat_sendImage": "Отправьте изображение",
|
||||
"chat_sendImageLora": "Отправить изображение через MeshCore",
|
||||
"chat_imagePickFailed": "Не удалось открыть это изображение",
|
||||
"chat_receivedGif": "Получен GIF",
|
||||
"repeater_keySettings": "Изменить ключи идентичности",
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Vybrať akciu odoslania",
|
||||
"chat_sendGif": "Odoslať GIF",
|
||||
"chat_reply": "Odpovedať",
|
||||
"chat_addReaction": "Pridať Reakciu",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Region: žiadné",
|
||||
"channels_regionSelect_Title": "Vyberte region",
|
||||
"channels_clearRegion": "Jasný údajný oblasť",
|
||||
"chat_sendImage": "Vyslat obraz",
|
||||
"chat_sendImageLora": "Odoslať obrázok cez MeshCore",
|
||||
"chat_imagePickFailed": "Nesmiela jsem otvoriť tento obrázok",
|
||||
"chat_receivedGif": "Odeslaný GIF",
|
||||
"repeater_keySettings": "Zmena identititačných klíčov",
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Izberite dejanje pošiljanja",
|
||||
"chat_sendGif": "Pošlji GIF",
|
||||
"chat_reply": "Odgovori",
|
||||
"chat_addReaction": "Dodaj reakcijo",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Region: brak",
|
||||
"channels_regionSelect_Title": "Vablajte region",
|
||||
"channels_clearRegion": "Jasna regija",
|
||||
"chat_sendImage": "Sločaji slik",
|
||||
"chat_sendImageLora": "Pošlji sliko prek MeshCore",
|
||||
"chat_imagePickFailed": "Nispeval sem tega ta slik",
|
||||
"chat_receivedGif": "Otrvljen GIF",
|
||||
"repeater_keySettings": "Zmeničke ključe identitete",
|
||||
|
||||
+2
-1
@@ -485,6 +485,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Välj sändningsåtgärd",
|
||||
"chat_sendGif": "Skicka GIF",
|
||||
"chat_reply": "Svara",
|
||||
"chat_addReaction": "Lägg till reaktion",
|
||||
@@ -2756,7 +2757,7 @@
|
||||
"channels_regionNotSet": "Region: ingen",
|
||||
"channels_regionSelect_Title": "Välj en region",
|
||||
"channels_clearRegion": "klar region",
|
||||
"chat_sendImage": "Send vagnbild",
|
||||
"chat_sendImageLora": "Skicka bild via MeshCore",
|
||||
"chat_imagePickFailed": "Kunde inte öppna det bildet",
|
||||
"chat_receivedGif": "Mottagit en GIF",
|
||||
"repeater_keySettings": "Ändra identitetsnyckel",
|
||||
|
||||
+2
-1
@@ -488,6 +488,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "Виберіть дію надсилання",
|
||||
"chat_sendGif": "Надіслати GIF",
|
||||
"chat_reply": "Відповісти",
|
||||
"chat_addReaction": "Додати реакцію",
|
||||
@@ -2736,7 +2737,7 @@
|
||||
"channels_regionNotSet": "Ріон: нема",
|
||||
"channels_regionSelect_Title": "Вybірте регіон",
|
||||
"channels_clearRegion": "Чистя зона",
|
||||
"chat_sendImage": "Нашкоду зовні\n\n(or more naturally, depending on context)\n\nПошукуєте изображення",
|
||||
"chat_sendImageLora": "Надіслати зображення через MeshCore",
|
||||
"chat_imagePickFailed": "Неможливо відкрити це изображення",
|
||||
"chat_receivedGif": "Підймовано GIF",
|
||||
"repeater_keySettings": "Зміна ключів ідентифікації",
|
||||
|
||||
+2
-1
@@ -512,6 +512,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"chat_selectSendAction": "选择发送操作",
|
||||
"chat_sendGif": "发送 GIF",
|
||||
"chat_reply": "回复",
|
||||
"chat_addReaction": "添加表情",
|
||||
@@ -2761,7 +2762,7 @@
|
||||
"channels_regionNotSet": "地区:无",
|
||||
"channels_regionSelect_Title": "选择一个地区",
|
||||
"channels_clearRegion": "无碍区域",
|
||||
"chat_sendImage": "发送图片",
|
||||
"chat_sendImageLora": "通过 MeshCore 发送图片",
|
||||
"chat_imagePickFailed": "无法打开该图片",
|
||||
"chat_receivedGif": "收到一个GIF",
|
||||
"repeater_keySettings": "更改身份密钥",
|
||||
|
||||
@@ -50,7 +50,7 @@ class ChannelMessage {
|
||||
final String? replyToMessageId;
|
||||
final String? replyToSenderName;
|
||||
final String? replyToText;
|
||||
final Map<String, int> reactions;
|
||||
final Map<String, List<String?>> reactions;
|
||||
|
||||
ChannelMessage({
|
||||
this.senderKey,
|
||||
@@ -76,7 +76,7 @@ class ChannelMessage {
|
||||
this.replyToMessageId,
|
||||
this.replyToSenderName,
|
||||
this.replyToText,
|
||||
Map<String, int>? reactions,
|
||||
Map<String, List<String?>>? reactions,
|
||||
}) : messageId =
|
||||
messageId ??
|
||||
'${timestamp.millisecondsSinceEpoch}_${senderName.hashCode}_${text.hashCode}',
|
||||
@@ -107,7 +107,7 @@ class ChannelMessage {
|
||||
Object? translatedLanguageCode = _unset,
|
||||
MessageTranslationStatus? translationStatus,
|
||||
Object? translationModelId = _unset,
|
||||
Map<String, int>? reactions,
|
||||
Map<String, List<String?>>? reactions,
|
||||
}) {
|
||||
return ChannelMessage(
|
||||
senderKey: senderKey,
|
||||
@@ -297,8 +297,32 @@ class ChannelMessage {
|
||||
);
|
||||
}
|
||||
|
||||
static ReactionInfo? parseReaction(String text) {
|
||||
return ReactionHelper.parseReaction(text);
|
||||
ReactionInfo? parseReaction() {
|
||||
final reactionInfo = ReactionHelper.parseReaction(text);
|
||||
reactionInfo?.senderName = senderName;
|
||||
return reactionInfo;
|
||||
}
|
||||
|
||||
String computeReactionHash() {
|
||||
return ReactionHelper.computeReactionHash(
|
||||
timestamp.millisecondsSinceEpoch ~/ 1000,
|
||||
senderName,
|
||||
text,
|
||||
);
|
||||
}
|
||||
|
||||
List<ReactionInfo> reactionList() {
|
||||
final String hash = computeReactionHash();
|
||||
List<ReactionInfo> reactionList = [];
|
||||
for (final entry in reactions.entries) {
|
||||
final emoji = entry.key;
|
||||
for (final senderName in entry.value) {
|
||||
reactionList.add(
|
||||
ReactionInfo(targetHash: hash, emoji: emoji, senderName: senderName),
|
||||
);
|
||||
}
|
||||
}
|
||||
return reactionList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ enum MessageStatus { pending, sent, delivered, failed }
|
||||
class Message {
|
||||
static const Object _unset = Object();
|
||||
|
||||
final Uint8List senderKey;
|
||||
final Uint8List senderKey; // For outgoing msgs, gets used as recipientKey
|
||||
final String text;
|
||||
final DateTime timestamp;
|
||||
final bool isOutgoing;
|
||||
@@ -30,7 +30,7 @@ class Message {
|
||||
final int? tripTimeMs;
|
||||
final int? pathLength;
|
||||
final Uint8List pathBytes;
|
||||
final Map<String, int> reactions;
|
||||
final Map<String, List<String?>> reactions;
|
||||
final Map<String, MessageStatus> reactionStatuses;
|
||||
final Uint8List fourByteRoomContactKey;
|
||||
|
||||
@@ -56,7 +56,7 @@ class Message {
|
||||
this.pathLength,
|
||||
Uint8List? pathBytes,
|
||||
Uint8List? fourByteRoomContactKey,
|
||||
Map<String, int>? reactions,
|
||||
Map<String, List<String?>>? reactions,
|
||||
Map<String, MessageStatus>? reactionStatuses,
|
||||
}) : messageId =
|
||||
messageId ??
|
||||
@@ -84,7 +84,7 @@ class Message {
|
||||
Object? translatedLanguageCode = _unset,
|
||||
MessageTranslationStatus? translationStatus,
|
||||
Object? translationModelId = _unset,
|
||||
Map<String, int>? reactions,
|
||||
Map<String, List<String?>>? reactions,
|
||||
Map<String, MessageStatus>? reactionStatuses,
|
||||
Uint8List? fourByteRoomContactKey,
|
||||
}) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import '../helpers/chat_scroll_controller.dart';
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/cyr2lat.dart';
|
||||
import '../helpers/gif_helper.dart';
|
||||
import '../helpers/message_url_image_helper.dart';
|
||||
import '../helpers/path_helper.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../helpers/snack_bar_builder.dart';
|
||||
@@ -41,7 +42,6 @@ import '../widgets/emoji_picker.dart';
|
||||
import '../widgets/gif_message.dart';
|
||||
import '../widgets/jump_to_bottom_button.dart';
|
||||
import '../widgets/gif_picker.dart';
|
||||
import '../widgets/image_send_button.dart';
|
||||
import '../widgets/image_send_codec_binding.dart';
|
||||
import '../widgets/image_send_preview_sheet.dart';
|
||||
import '../widgets/message_translation_button.dart';
|
||||
@@ -413,6 +413,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
final urlImagesEnabled = connector.isChannelUrlImagesEnabled(
|
||||
widget.channel.index,
|
||||
);
|
||||
// Images are not ChannelMessages: they arrive as GRP_DATA
|
||||
// chunks and are owned by ReceivedImageStore, so the two
|
||||
// sources are merged here in timestamp order and the list
|
||||
@@ -501,7 +504,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
);
|
||||
final message = row.message;
|
||||
final bubble = message != null
|
||||
? _buildMessageBubble(message, textScale)
|
||||
? _buildMessageBubble(
|
||||
message,
|
||||
textScale,
|
||||
urlImagesEnabled,
|
||||
)
|
||||
: _buildImageBubble(
|
||||
row.image!,
|
||||
textScale,
|
||||
@@ -525,7 +532,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
_buildMessageComposer(),
|
||||
_buildInputBar(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -544,7 +551,11 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
connector.setChannelUnreadCount(widget.channel.index, count);
|
||||
}
|
||||
|
||||
Widget _buildMessageBubble(ChannelMessage message, double textScale) {
|
||||
Widget _buildMessageBubble(
|
||||
ChannelMessage message,
|
||||
double textScale,
|
||||
bool urlImagesEnabled,
|
||||
) {
|
||||
final settingsService = context.watch<AppSettingsService>();
|
||||
final enableTracing = settingsService.settings.enableMessageTracing;
|
||||
final isOutgoing = message.isOutgoing;
|
||||
@@ -584,6 +595,33 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
final metaColor = textColor.withValues(alpha: 0.65);
|
||||
const bodyFontSize = 14.0;
|
||||
|
||||
Widget buildTextContent() {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
fontSize: bodyFontSize * textScale,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: textColor.withValues(alpha: 0.72),
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop
|
||||
? () => _showMessageActions(message)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// Asymmetric radius matching chat_screen bubbles.
|
||||
final borderRadius = isOutgoing
|
||||
? const BorderRadius.only(
|
||||
@@ -689,29 +727,76 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
),
|
||||
],
|
||||
)
|
||||
else if (urlImagesEnabled)
|
||||
MessageUrlImageFutureBuilder(
|
||||
messageId: message.messageId,
|
||||
text: message.text,
|
||||
builder: (context, snapshot) {
|
||||
final imageAttachment = snapshot.data;
|
||||
|
||||
if (imageAttachment != null) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
),
|
||||
child: Align(
|
||||
alignment: isOutgoing
|
||||
? Alignment.centerRight
|
||||
: Alignment.centerLeft,
|
||||
child: MessageUrlImagePreview(
|
||||
imageUrl: imageAttachment,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
fontSize: bodyFontSize * textScale,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: textColor.withValues(
|
||||
alpha: 0.72,
|
||||
),
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop
|
||||
? () => _showMessageActions(message)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return buildTextContent();
|
||||
},
|
||||
)
|
||||
else
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
if (MessageUrlImageHelper.hasPotentialImageUrl(
|
||||
message.text,
|
||||
))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: Text(
|
||||
context.l10n.urlImage_possible,
|
||||
style: TextStyle(
|
||||
color: metaColor,
|
||||
fontSize: 11 * textScale,
|
||||
),
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
fontSize: bodyFontSize * textScale,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: textColor.withValues(alpha: 0.72),
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop
|
||||
? () => _showMessageActions(message)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
buildTextContent(),
|
||||
],
|
||||
),
|
||||
if (enableTracing && displayPath.isNotEmpty) ...[
|
||||
@@ -961,7 +1046,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
runSpacing: 6,
|
||||
children: message.reactions.entries.map((entry) {
|
||||
final emoji = entry.key;
|
||||
final count = entry.value;
|
||||
final int count = entry.value.length;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
@@ -970,35 +1055,97 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
borderRadius: BorderRadius.circular(MeshRadii.pill),
|
||||
border: Border.all(color: scheme.outlineVariant, width: 1),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
emoji,
|
||||
style: MeshTheme.emoji(fontSize: 16),
|
||||
textHeightBehavior: const TextHeightBehavior(
|
||||
applyHeightToFirstAscent: false,
|
||||
applyHeightToLastDescent: false,
|
||||
),
|
||||
),
|
||||
if (count > 1) ...[
|
||||
const SizedBox(width: 4),
|
||||
child: InkWell(
|
||||
onTap: () => _showReactionsReport(message),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'$count',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: scheme.onSurface,
|
||||
emoji,
|
||||
style: MeshTheme.emoji(fontSize: 16),
|
||||
textHeightBehavior: const TextHeightBehavior(
|
||||
applyHeightToFirstAscent: false,
|
||||
applyHeightToLastDescent: false,
|
||||
),
|
||||
),
|
||||
if (count > 1) ...[
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'$count',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
void _showReactionsReport(ChannelMessage message) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.l10n.reaction_report),
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
children: message.reactionList().map((reaction) {
|
||||
return Container(
|
||||
padding: const EdgeInsetsDirectional.symmetric(vertical: 4),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surfaceContainerHigh,
|
||||
borderRadius: BorderRadius.circular(MeshRadii.pill),
|
||||
border: Border.all(
|
||||
color: scheme.outlineVariant,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
reaction.emoji,
|
||||
style: MeshTheme.emoji(fontSize: 16),
|
||||
textHeightBehavior: const TextHeightBehavior(
|
||||
applyHeightToFirstAscent: false,
|
||||
applyHeightToLastDescent: false,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(child: Text(reaction.senderName ?? '???')),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPoiMessage(
|
||||
BuildContext context,
|
||||
MarkerPayload poi,
|
||||
@@ -1079,10 +1226,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
|
||||
/// Whether the image codec model is currently downloading.
|
||||
///
|
||||
/// The image button must stay hidden while the model downloads: an encode
|
||||
/// cannot start until the weights are on disk, and the preview sheet would
|
||||
/// have nothing to show but a spinner.
|
||||
bool get _imageCodecDownloading {
|
||||
/// This must be read while [context] is building; popup item builders run
|
||||
/// from an overlay and cannot listen to a provider.
|
||||
bool _isImageCodecDownloading(BuildContext context) {
|
||||
try {
|
||||
return context.watch<ImageCodecService>().isDownloading;
|
||||
} on ProviderNotFoundException {
|
||||
@@ -1603,41 +1749,84 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMessageComposer() {
|
||||
Widget _buildInputBar() {
|
||||
final connector = context.watch<MeshCoreConnector>();
|
||||
final maxBytes = maxChannelMessageBytes(connector.selfName);
|
||||
final settings = context.watch<AppSettingsService>().settings;
|
||||
final imageCodecDownloading = _isImageCodecDownloading(context);
|
||||
final showImageAction =
|
||||
settings.imageMessagesEnabled && !imageCodecDownloading;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (_replyingToMessage != null)
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final textScale = context.select<ChatTextScaleService, double>(
|
||||
(service) => service.scale,
|
||||
);
|
||||
return _buildReplyBanner(textScale);
|
||||
},
|
||||
),
|
||||
if (_imageSendTotal > 0) _buildImageSendProgress(scheme),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surface,
|
||||
border: Border(
|
||||
top: BorderSide(color: scheme.outlineVariant, width: 1),
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Padding(
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: scheme.surface,
|
||||
border: Border(top: BorderSide(color: scheme.outlineVariant, width: 1)),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (_replyingToMessage != null)
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final textScale = context
|
||||
.select<ChatTextScaleService, double>(
|
||||
(service) => service.scale,
|
||||
);
|
||||
return _buildReplyBanner(textScale);
|
||||
},
|
||||
),
|
||||
if (_imageSendTotal > 0) _buildImageSendProgress(scheme),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.gif_box),
|
||||
onPressed: () => _showGifPicker(context),
|
||||
tooltip: context.l10n.chat_sendGif,
|
||||
PopupMenuButton<String>(
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
position: PopupMenuPosition.over,
|
||||
offset: Offset(0, showImageAction ? -112 : -64),
|
||||
tooltip: context.l10n.chat_selectSendAction,
|
||||
onSelected: (action) {
|
||||
switch (action) {
|
||||
case 'gif':
|
||||
_showGifPicker(context);
|
||||
break;
|
||||
case 'meshcore-image':
|
||||
_showImageSendPreview();
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: 'gif',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.gif_box),
|
||||
const SizedBox(width: 12),
|
||||
Text(context.l10n.chat_sendGif),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (showImageAction)
|
||||
PopupMenuItem(
|
||||
value: 'meshcore-image',
|
||||
// Gated on the codec, not just the setting. The preview
|
||||
// sheet explains why a send is impossible, but a fully
|
||||
// live button in a build that cannot encode invites the
|
||||
// tap that produces that explanation.
|
||||
enabled:
|
||||
_imageCodec?.availability ==
|
||||
ImageCodecAvailability.ready,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.image_outlined),
|
||||
const SizedBox(width: 12),
|
||||
Text(context.l10n.chat_sendImageLora),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (settings.translationEnabled)
|
||||
MessageTranslationButton(
|
||||
@@ -1645,17 +1834,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
languageCode: settings.translationTargetLanguageCode,
|
||||
onPressed: _showTranslationOptions,
|
||||
),
|
||||
if (settings.imageMessagesEnabled && !_imageCodecDownloading)
|
||||
ImageSendButton(
|
||||
// Gated on the codec, not just the setting. The preview
|
||||
// sheet explains why a send is impossible, but a fully
|
||||
// live button in a build that cannot encode invites the
|
||||
// tap that produces that explanation.
|
||||
enabled:
|
||||
_imageCodec?.availability ==
|
||||
ImageCodecAvailability.ready,
|
||||
onPressed: () => _showImageSendPreview(),
|
||||
),
|
||||
Expanded(
|
||||
child: ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: _textController,
|
||||
@@ -1787,9 +1965,9 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2037,12 +2215,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
||||
final connector = context.read<MeshCoreConnector>();
|
||||
final emojiIndex = ReactionHelper.emojiToIndex(emoji);
|
||||
if (emojiIndex == null) return; // Unknown emoji, skip
|
||||
final timestampSecs = message.timestamp.millisecondsSinceEpoch ~/ 1000;
|
||||
final hash = ReactionHelper.computeReactionHash(
|
||||
timestampSecs,
|
||||
message.senderName,
|
||||
message.text,
|
||||
);
|
||||
final hash = message.computeReactionHash();
|
||||
final reactionText = ReactionHelper.encodeReaction(hash, emojiIndex);
|
||||
connector.sendChannelMessage(widget.channel, reactionText);
|
||||
}
|
||||
|
||||
@@ -1533,6 +1533,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
final pskController = TextEditingController(text: channel.pskHex);
|
||||
bool smazEnabled = connector.isChannelSmazEnabled(channel.index);
|
||||
bool cyr2latEnabled = connector.isChannelCyr2LatEnabled(channel.index);
|
||||
bool urlImagesEnabled = connector.isChannelUrlImagesEnabled(channel.index);
|
||||
String? selectedCyr2LatProfileId = connector.getChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
);
|
||||
@@ -1635,6 +1636,13 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
),
|
||||
),
|
||||
],
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(sheetContext.l10n.urlImage_enable),
|
||||
value: urlImagesEnabled,
|
||||
onChanged: (value) =>
|
||||
setSheetState(() => urlImagesEnabled = value),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
@@ -1684,6 +1692,10 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
channel.index,
|
||||
cyr2latEnabled,
|
||||
);
|
||||
await connector.setChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
urlImagesEnabled,
|
||||
);
|
||||
await connector.setChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
selectedCyr2LatProfileId,
|
||||
|
||||
+133
-23
@@ -7,11 +7,13 @@ import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../utils/app_logger.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
|
||||
import '../connector/meshcore_connector.dart';
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
import '../helpers/cyr2lat.dart';
|
||||
import '../helpers/message_url_image_helper.dart';
|
||||
import '../helpers/path_helper.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../widgets/message_status_icon.dart';
|
||||
@@ -477,10 +479,26 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.gif_box),
|
||||
onPressed: () => _showGifPicker(context),
|
||||
tooltip: context.l10n.chat_sendGif,
|
||||
PopupMenuButton<String>(
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
position: PopupMenuPosition.over,
|
||||
offset: const Offset(0, -64),
|
||||
tooltip: context.l10n.chat_selectSendAction,
|
||||
onSelected: (action) {
|
||||
if (action == 'gif') _showGifPicker(context);
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: 'gif',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.gif_box),
|
||||
const SizedBox(width: 12),
|
||||
Text(context.l10n.chat_sendGif),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (settings.translationEnabled)
|
||||
MessageTranslationButton(
|
||||
@@ -878,6 +896,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
bool cyr2latEnabled = connector.isContactCyr2LatEnabled(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
bool urlImagesEnabled = connector.isContactUrlImagesEnabled(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
String? selectedCyr2LatProfileId = connector.getContactCyr2LatProfileId(
|
||||
contact.publicKeyHex,
|
||||
);
|
||||
@@ -977,6 +998,19 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
),
|
||||
],
|
||||
const Divider(height: 8),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(context.l10n.urlImage_enable),
|
||||
value: urlImagesEnabled,
|
||||
onChanged: (value) {
|
||||
connector.setContactUrlImagesEnabled(
|
||||
contact.publicKeyHex,
|
||||
value,
|
||||
);
|
||||
setDialogState(() => urlImagesEnabled = value);
|
||||
},
|
||||
),
|
||||
const Divider(height: 8),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(context.l10n.contact_teleBase),
|
||||
@@ -1281,6 +1315,7 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
final senderName = liveContact.type == advTypeRoom
|
||||
? senderContact.name
|
||||
: null;
|
||||
appLogger.info('Sending reaction using senderName: $senderName');
|
||||
final hash = ReactionHelper.computeReactionHash(
|
||||
timestampSecs,
|
||||
senderName,
|
||||
@@ -1317,6 +1352,9 @@ class _MessageBubble extends StatelessWidget {
|
||||
final gifId = GifHelper.parseGif(message.text);
|
||||
final poi = parseMarkerText(message.text);
|
||||
final isFailed = message.status == MessageStatus.failed;
|
||||
final urlImagesEnabled = context.select<MeshCoreConnector, bool>(
|
||||
(connector) => connector.isContactUrlImagesEnabled(sourceId),
|
||||
);
|
||||
|
||||
// Bubble colors — outgoing uses MeshPalette.me / meBorder / meInk.
|
||||
final bubbleColor = isFailed
|
||||
@@ -1364,6 +1402,30 @@ class _MessageBubble extends StatelessWidget {
|
||||
? message.originalText
|
||||
: (translatedDisplayText != messageText ? messageText : null);
|
||||
|
||||
Widget buildTextContent() {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
color: textColor.withValues(alpha: 0.72),
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop ? onLongPress : null,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 3),
|
||||
child: Column(
|
||||
@@ -1451,28 +1513,76 @@ class _MessageBubble extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
)
|
||||
else if (urlImagesEnabled)
|
||||
MessageUrlImageFutureBuilder(
|
||||
messageId: message.messageId,
|
||||
text: message.text,
|
||||
builder: (context, snapshot) {
|
||||
final imageAttachment = snapshot.data;
|
||||
|
||||
if (imageAttachment != null) {
|
||||
return Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
),
|
||||
child: Align(
|
||||
alignment: isOutgoing
|
||||
? Alignment.centerRight
|
||||
: Alignment.centerLeft,
|
||||
child: MessageUrlImagePreview(
|
||||
imageUrl: imageAttachment,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
color: textColor.withValues(
|
||||
alpha: 0.72,
|
||||
),
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop
|
||||
? onLongPress
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return buildTextContent();
|
||||
},
|
||||
)
|
||||
else
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: TranslatedMessageContent(
|
||||
displayText: translatedDisplayText,
|
||||
originalText: originalDisplayText,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontSize: bodyFontSize * textScale,
|
||||
if (MessageUrlImageHelper.hasPotentialImageUrl(
|
||||
message.text,
|
||||
))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: Text(
|
||||
context.l10n.urlImage_possible,
|
||||
style: TextStyle(
|
||||
color: metaColor,
|
||||
fontSize: 11 * textScale,
|
||||
),
|
||||
),
|
||||
originalStyle: TextStyle(
|
||||
color: textColor.withValues(alpha: 0.72),
|
||||
fontSize: bodyFontSize * textScale,
|
||||
),
|
||||
onSecondaryTap: PlatformInfo.isDesktop
|
||||
? onLongPress
|
||||
: null,
|
||||
),
|
||||
),
|
||||
buildTextContent(),
|
||||
],
|
||||
),
|
||||
if (enableTracing &&
|
||||
@@ -1654,7 +1764,7 @@ class _MessageBubble extends StatelessWidget {
|
||||
runSpacing: 6,
|
||||
children: message.reactions.entries.map((entry) {
|
||||
final emoji = entry.key;
|
||||
final count = entry.value;
|
||||
final count = entry.value.length;
|
||||
final status = message.reactionStatuses[emoji];
|
||||
final isPending =
|
||||
status == MessageStatus.pending || status == MessageStatus.sent;
|
||||
|
||||
@@ -3,7 +3,9 @@ import 'dart:ui';
|
||||
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
|
||||
import '../helpers/message_url_image_helper.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
@@ -196,14 +198,40 @@ class NotificationService {
|
||||
return text;
|
||||
}
|
||||
|
||||
Future<String?> _resolveNotificationImagePath(
|
||||
String text, {
|
||||
required bool urlImagesEnabled,
|
||||
}) async {
|
||||
if (!urlImagesEnabled) return null;
|
||||
|
||||
final imageUrl = await MessageUrlImageHelper.parseVerified(text);
|
||||
if (imageUrl == null) return null;
|
||||
|
||||
try {
|
||||
// Cache the image so notification platforms can read it from disk.
|
||||
final imageFile = await DefaultCacheManager().getSingleFile(imageUrl);
|
||||
if (!imageFile.existsSync()) return null;
|
||||
return imageFile.path;
|
||||
} catch (e) {
|
||||
debugPrint('Failed to resolve notification image: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _showMessageNotificationImpl({
|
||||
required String contactName,
|
||||
required String message,
|
||||
required bool urlImagesEnabled,
|
||||
String? contactId,
|
||||
int? badgeCount,
|
||||
}) async {
|
||||
if (!await _ensureCanNotify()) return;
|
||||
|
||||
final imagePath = await _resolveNotificationImagePath(
|
||||
message,
|
||||
urlImagesEnabled: urlImagesEnabled,
|
||||
);
|
||||
|
||||
final androidDetails = AndroidNotificationDetails(
|
||||
'messages',
|
||||
'Messages',
|
||||
@@ -212,6 +240,12 @@ class NotificationService {
|
||||
priority: Priority.high,
|
||||
icon: '@mipmap/ic_launcher',
|
||||
number: badgeCount,
|
||||
styleInformation: imagePath != null
|
||||
? BigPictureStyleInformation(
|
||||
FilePathAndroidBitmap(imagePath),
|
||||
summaryText: formatNotificationText(message),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
||||
final iosDetails = DarwinNotificationDetails(
|
||||
@@ -219,6 +253,11 @@ class NotificationService {
|
||||
presentBadge: true,
|
||||
presentSound: true,
|
||||
badgeNumber: badgeCount,
|
||||
attachments: imagePath != null
|
||||
? <DarwinNotificationAttachment>[
|
||||
DarwinNotificationAttachment(imagePath),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
|
||||
final macDetails = DarwinNotificationDetails(
|
||||
@@ -226,6 +265,11 @@ class NotificationService {
|
||||
presentBadge: true,
|
||||
presentSound: true,
|
||||
badgeNumber: badgeCount,
|
||||
attachments: imagePath != null
|
||||
? <DarwinNotificationAttachment>[
|
||||
DarwinNotificationAttachment(imagePath),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
|
||||
final notificationDetails = NotificationDetails(
|
||||
@@ -299,11 +343,17 @@ class NotificationService {
|
||||
Future<void> _showChannelMessageNotificationImpl({
|
||||
required String channelName,
|
||||
required String message,
|
||||
required bool urlImagesEnabled,
|
||||
int? channelIndex,
|
||||
int? badgeCount,
|
||||
}) async {
|
||||
if (!await _ensureCanNotify()) return;
|
||||
|
||||
final imagePath = await _resolveNotificationImagePath(
|
||||
message,
|
||||
urlImagesEnabled: urlImagesEnabled,
|
||||
);
|
||||
|
||||
final androidDetails = AndroidNotificationDetails(
|
||||
'channel_messages',
|
||||
'Channel Messages',
|
||||
@@ -312,6 +362,12 @@ class NotificationService {
|
||||
priority: Priority.high,
|
||||
icon: '@mipmap/ic_launcher',
|
||||
number: badgeCount,
|
||||
styleInformation: imagePath != null
|
||||
? BigPictureStyleInformation(
|
||||
FilePathAndroidBitmap(imagePath),
|
||||
summaryText: formatNotificationText(message),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
||||
final iosDetails = DarwinNotificationDetails(
|
||||
@@ -319,6 +375,11 @@ class NotificationService {
|
||||
presentBadge: true,
|
||||
presentSound: true,
|
||||
badgeNumber: badgeCount,
|
||||
attachments: imagePath != null
|
||||
? <DarwinNotificationAttachment>[
|
||||
DarwinNotificationAttachment(imagePath),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
|
||||
final macDetails = DarwinNotificationDetails(
|
||||
@@ -326,6 +387,11 @@ class NotificationService {
|
||||
presentBadge: true,
|
||||
presentSound: true,
|
||||
badgeNumber: badgeCount,
|
||||
attachments: imagePath != null
|
||||
? <DarwinNotificationAttachment>[
|
||||
DarwinNotificationAttachment(imagePath),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
|
||||
final notificationDetails = NotificationDetails(
|
||||
@@ -448,6 +514,7 @@ class NotificationService {
|
||||
Future<void> showMessageNotification({
|
||||
required String contactName,
|
||||
required String message,
|
||||
required bool urlImagesEnabled,
|
||||
String? contactId,
|
||||
int? badgeCount,
|
||||
}) async {
|
||||
@@ -458,6 +525,7 @@ class NotificationService {
|
||||
type: _NotificationType.message,
|
||||
title: contactName,
|
||||
body: message,
|
||||
urlImagesEnabled: urlImagesEnabled,
|
||||
id: contactId,
|
||||
badgeCount: badgeCount,
|
||||
),
|
||||
@@ -485,6 +553,7 @@ class NotificationService {
|
||||
required String channelName,
|
||||
required String senderName,
|
||||
required String message,
|
||||
required bool urlImagesEnabled,
|
||||
int? channelIndex,
|
||||
int? badgeCount,
|
||||
}) async {
|
||||
@@ -495,6 +564,7 @@ class NotificationService {
|
||||
type: _NotificationType.channelMessage,
|
||||
title: channelName,
|
||||
body: '$senderName: $message',
|
||||
urlImagesEnabled: urlImagesEnabled,
|
||||
id: channelIndex?.toString(),
|
||||
badgeCount: badgeCount,
|
||||
),
|
||||
@@ -556,6 +626,7 @@ class NotificationService {
|
||||
await _showMessageNotificationImpl(
|
||||
contactName: notification.title,
|
||||
message: notification.body,
|
||||
urlImagesEnabled: notification.urlImagesEnabled,
|
||||
contactId: notification.id,
|
||||
badgeCount: notification.badgeCount,
|
||||
);
|
||||
@@ -571,6 +642,7 @@ class NotificationService {
|
||||
await _showChannelMessageNotificationImpl(
|
||||
channelName: notification.title,
|
||||
message: notification.body,
|
||||
urlImagesEnabled: notification.urlImagesEnabled,
|
||||
channelIndex: int.tryParse(notification.id ?? ''),
|
||||
badgeCount: notification.badgeCount,
|
||||
);
|
||||
@@ -647,6 +719,7 @@ class _PendingNotification {
|
||||
final _NotificationType type;
|
||||
final String title;
|
||||
final String body;
|
||||
final bool urlImagesEnabled;
|
||||
final String? id;
|
||||
final int? badgeCount;
|
||||
|
||||
@@ -654,6 +727,7 @@ class _PendingNotification {
|
||||
required this.type,
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.urlImagesEnabled = false,
|
||||
this.id,
|
||||
this.badgeCount,
|
||||
});
|
||||
|
||||
@@ -195,7 +195,12 @@ class ChannelMessageStore {
|
||||
replyToText: json['replyToText'] as String?,
|
||||
reactions:
|
||||
(json['reactions'] as Map<String, dynamic>?)?.map(
|
||||
(key, value) => MapEntry(key, value as int),
|
||||
(key, value) => MapEntry(
|
||||
key,
|
||||
(value is int)
|
||||
? List<String?>.filled(value, null)
|
||||
: List<String?>.from(value),
|
||||
),
|
||||
) ??
|
||||
{},
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'prefs_manager.dart';
|
||||
class ChannelSettingsStore {
|
||||
static const String _keyPrefix = 'channel_smaz_';
|
||||
static const String _cyr2latKeyPrefix = 'channel_cyr2lat_';
|
||||
static const String _urlImagesKeyPrefix = 'channel_url_images_';
|
||||
|
||||
String publicKeyHex = '';
|
||||
set setPublicKeyHex(String value) =>
|
||||
@@ -11,6 +12,7 @@ class ChannelSettingsStore {
|
||||
|
||||
String get keyFor => '$_keyPrefix$publicKeyHex';
|
||||
String get keyForCyr2Lat => '$_cyr2latKeyPrefix$publicKeyHex';
|
||||
String get keyForUrlImages => '$_urlImagesKeyPrefix$publicKeyHex';
|
||||
|
||||
Future<bool> loadSmazEnabled(int channelIndex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
@@ -73,6 +75,31 @@ class ChannelSettingsStore {
|
||||
await prefs.setBool(key, enabled);
|
||||
}
|
||||
|
||||
Future<bool> loadUrlImagesEnabled(int channelIndex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot load channel URL image settings.',
|
||||
);
|
||||
return false;
|
||||
}
|
||||
final prefs = PrefsManager.instance;
|
||||
final key = '$keyForUrlImages$channelIndex';
|
||||
return prefs.getBool(key) ?? false;
|
||||
}
|
||||
|
||||
Future<void> saveUrlImagesEnabled(int channelIndex, bool enabled) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot save channel URL image settings.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
await PrefsManager.instance.setBool(
|
||||
'$keyForUrlImages$channelIndex',
|
||||
enabled,
|
||||
);
|
||||
}
|
||||
|
||||
Future<String?> loadCyr2LatProfileId(int channelIndex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'prefs_manager.dart';
|
||||
class ContactSettingsStore {
|
||||
static const String _keyPrefix = 'contact_smaz_';
|
||||
static const String _cyr2latKeyPrefix = 'contact_cyr2lat_';
|
||||
static const String _urlImagesKeyPrefix = 'contact_url_images_';
|
||||
|
||||
String publicKeyHex = '';
|
||||
set setPublicKeyHex(String value) =>
|
||||
@@ -11,6 +12,7 @@ class ContactSettingsStore {
|
||||
|
||||
String get keyFor => '$_keyPrefix$publicKeyHex';
|
||||
String get keyForCyr2Lat => '$_cyr2latKeyPrefix$publicKeyHex';
|
||||
String get keyForUrlImages => '$_urlImagesKeyPrefix$publicKeyHex';
|
||||
|
||||
Future<bool> loadSmazEnabled(String contactKeyHex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
@@ -73,6 +75,31 @@ class ContactSettingsStore {
|
||||
await prefs.setBool(key, enabled);
|
||||
}
|
||||
|
||||
Future<bool> loadUrlImagesEnabled(String contactKeyHex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot load contact URL image settings.',
|
||||
);
|
||||
return false;
|
||||
}
|
||||
final prefs = PrefsManager.instance;
|
||||
final key = '$keyForUrlImages$contactKeyHex';
|
||||
return prefs.getBool(key) ?? false;
|
||||
}
|
||||
|
||||
Future<void> saveUrlImagesEnabled(String contactKeyHex, bool enabled) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot save contact URL image settings.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
await PrefsManager.instance.setBool(
|
||||
'$keyForUrlImages$contactKeyHex',
|
||||
enabled,
|
||||
);
|
||||
}
|
||||
|
||||
Future<String?> loadCyr2LatProfileId(String contactKeyHex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
|
||||
@@ -171,7 +171,12 @@ class MessageStore {
|
||||
pathBytes: decodedPathBytes,
|
||||
reactions:
|
||||
(json['reactions'] as Map<String, dynamic>?)?.map(
|
||||
(key, value) => MapEntry(key, value as int),
|
||||
(key, value) => MapEntry(
|
||||
key,
|
||||
(value is int)
|
||||
? List<String?>.filled(value, null)
|
||||
: List<String?>.from(value),
|
||||
),
|
||||
) ??
|
||||
{},
|
||||
reactionStatuses:
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/l10n.dart';
|
||||
|
||||
class ImageSendButton extends StatelessWidget {
|
||||
final bool enabled;
|
||||
final VoidCallback onPressed;
|
||||
final String? tooltip;
|
||||
|
||||
const ImageSendButton({
|
||||
super.key,
|
||||
required this.enabled,
|
||||
required this.onPressed,
|
||||
this.tooltip,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
icon: Icon(enabled ? Icons.image : Icons.image_outlined),
|
||||
onPressed: enabled ? onPressed : null,
|
||||
tooltip: tooltip ?? context.l10n.chat_sendImage,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user