update to current dev a50c0d0b2d

This commit is contained in:
ericz
2026-05-20 23:20:16 +02:00
parent 9ada4ea601
commit 3fe5cdf55d
14 changed files with 583 additions and 100 deletions
+5 -10
View File
@@ -485,6 +485,8 @@ class _ChatScreenState extends State<ChatScreen> {
final message = reversedMessages[messageIndex];
String fourByteHex = '';
if (contact.type == advTypeRoom) {
// Room-server messages carry the original author's 4-byte prefix
// separately from message.text; use it only for resolving the name.
contact = _resolveContactFrom4Bytes(
connector,
message.fourByteRoomContactKey.isEmpty
@@ -509,7 +511,6 @@ class _ChatScreenState extends State<ChatScreen> {
? "${contact.name} [$fourByteHex]"
: contact.name,
sourceId: widget.contact.publicKeyHex,
isRoomServer: resolvedContact.type == advTypeRoom,
textScale: textScale,
onTap: () => _openMessagePath(message, contact),
onLongPress: () => _showMessageActions(message, contact),
@@ -1577,11 +1578,8 @@ class _ChatScreenState extends State<ChatScreen> {
}
void _showMessageActions(Message message, Contact contact) {
final settings = context.read<AppSettingsService>().settings;
final translationService = context.read<TranslationService>();
final canTranslateMessage =
settings.translationEnabled &&
!settings.autoTranslateIncomingMessages &&
translationService.canTranslateIncoming(
text: message.text,
isCli: message.isCli,
@@ -1748,7 +1746,6 @@ class _ChatScreenState extends State<ChatScreen> {
class _MessageBubble extends StatelessWidget {
final Message message;
final String senderName;
final bool isRoomServer;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
final void Function(Message message, String emoji)? onRetryReaction;
@@ -1759,7 +1756,6 @@ class _MessageBubble extends StatelessWidget {
required this.message,
required this.senderName,
required this.sourceId,
required this.isRoomServer,
required this.textScale,
this.onTap,
this.onLongPress,
@@ -1785,10 +1781,9 @@ class _MessageBubble extends StatelessWidget {
: (isOutgoing ? colorScheme.onPrimary : colorScheme.onSurface);
final metaColor = textColor.withValues(alpha: 0.7);
const bodyFontSize = 14.0;
String messageText = message.text;
if (isRoomServer && !isOutgoing) {
messageText = message.text.substring(4.clamp(0, message.text.length));
}
// Do not strip room-server author bytes here: the parser stores them in
// fourByteRoomContactKey, so message.text is safe to render as-is.
final messageText = message.text;
final translatedDisplayText =
message.translatedText != null &&
message.translatedText!.trim().isNotEmpty