Merge origin/dev into cursor/routing-send-settings-ef15

This commit is contained in:
zjs81 committed 2026-11-21 08:33:50 -07:00
commit 4065d60a16
84 files changed
+7843 -1144

No files matched your search

+8
View File
@@ -123,6 +123,7 @@ class AppSettings {
final bool mapClusterNodes;
final bool enableMessageTracing;
final bool regionOnHopsLine;
final bool showCompressionIndicator;
final Map<String, double>? mapCacheBounds;
final int mapCacheMinZoom;
final int mapCacheMaxZoom;
@@ -299,6 +300,7 @@ class AppSettings {
this.mapClusterNodes = true,
this.enableMessageTracing = false,
this.regionOnHopsLine = false,
this.showCompressionIndicator = false,
this.mapCacheBounds,
this.mapCacheMinZoom = 10,
this.mapCacheMaxZoom = 15,
@@ -400,6 +402,7 @@ class AppSettings {
'map_cluster_nodes': mapClusterNodes,
'enable_message_tracing': enableMessageTracing,
'region_on_hops_line': regionOnHopsLine,
'show_compression_indicator': showCompressionIndicator,
'map_cache_bounds': mapCacheBounds,
'map_cache_min_zoom': mapCacheMinZoom,
'map_cache_max_zoom': mapCacheMaxZoom,
@@ -541,6 +544,8 @@ class AppSettings {
mapClusterNodes: json['map_cluster_nodes'] as bool? ?? true,
enableMessageTracing: json['enable_message_tracing'] as bool? ?? false,
regionOnHopsLine: json['region_on_hops_line'] as bool? ?? false,
showCompressionIndicator:
json['show_compression_indicator'] as bool? ?? false,
mapCacheBounds: (json['map_cache_bounds'] as Map?)?.map(
(key, value) => MapEntry(key.toString(), (value as num).toDouble()),
),
@@ -720,6 +725,7 @@ class AppSettings {
bool? mapClusterNodes,
bool? enableMessageTracing,
bool? regionOnHopsLine,
bool? showCompressionIndicator,
Object? mapCacheBounds = _unset,
int? mapCacheMinZoom,
int? mapCacheMaxZoom,
@@ -807,6 +813,8 @@ class AppSettings {
mapClusterNodes: mapClusterNodes ?? this.mapClusterNodes,
enableMessageTracing: enableMessageTracing ?? this.enableMessageTracing,
regionOnHopsLine: regionOnHopsLine ?? this.regionOnHopsLine,
showCompressionIndicator:
showCompressionIndicator ?? this.showCompressionIndicator,
mapCacheBounds: mapCacheBounds == _unset
? this.mapCacheBounds
: mapCacheBounds as Map<String, double>?,
+10 -1
View File
@@ -1,4 +1,5 @@
import 'dart:typed_data';
import '../connector/meshcore_protocol.dart';
import '../helpers/reaction_helper.dart';
import '../helpers/smaz.dart';
@@ -44,6 +45,7 @@ class ChannelMessage {
final DateTime receivedAt;
final bool isOutgoing;
final bool isBookmarked;
final bool isSmazCompressed;
final ChannelMessageStatus status;
final List<Repeat> repeats;
final int repeatCount;
@@ -79,6 +81,7 @@ class ChannelMessage {
DateTime? receivedAt,
required this.isOutgoing,
this.isBookmarked = false,
this.isSmazCompressed = false,
this.status = ChannelMessageStatus.pending,
this.repeats = const [],
this.repeatCount = 0,
@@ -120,6 +123,7 @@ class ChannelMessage {
ChannelMessage copyWith({
ChannelMessageStatus? status,
bool? isBookmarked,
bool? isSmazCompressed,
List<Repeat>? repeats,
int? repeatCount,
int? pathLength,
@@ -163,6 +167,7 @@ class ChannelMessage {
receivedAt: receivedAt,
isOutgoing: isOutgoing,
isBookmarked: isBookmarked ?? this.isBookmarked,
isSmazCompressed: isSmazCompressed ?? this.isSmazCompressed,
status: status ?? this.status,
repeats: repeats ?? this.repeats,
repeatCount: repeatCount ?? this.repeatCount,
@@ -252,7 +257,8 @@ class ChannelMessage {
}
}
final decodedText = Smaz.tryDecodePrefixed(actualText) ?? actualText;
final smazDecoded = Smaz.tryDecodePrefixed(actualText);
final decodedText = smazDecoded ?? actualText;
return ChannelMessage(
senderKey: null,
@@ -261,6 +267,7 @@ class ChannelMessage {
timestamp: DateTime.fromMillisecondsSinceEpoch(timestampRaw * 1000),
receivedAt: DateTime.now(),
isOutgoing: false,
isSmazCompressed: smazDecoded != null,
status: ChannelMessageStatus.sent,
pathLength: pathLen,
pathHashWidth: packetPathHashWidth,
@@ -283,6 +290,7 @@ class ChannelMessage {
String? translationModelId,
String? region,
ChannelMessage? replyTo,
bool isSmazCompressed = false,
}) {
return ChannelMessage(
senderKey: null,
@@ -296,6 +304,7 @@ class ChannelMessage {
replyToText: replyTo?.text,
timestamp: DateTime.now(),
isOutgoing: true,
isSmazCompressed: isSmazCompressed,
status: ChannelMessageStatus.pending,
pathLength: null,
pathBytes: Uint8List(0),
+12 -1
View File
@@ -1,6 +1,8 @@
import 'dart:typed_data';
import '../connector/meshcore_protocol.dart';
import '../helpers/reaction_helper.dart';
import '../helpers/smaz.dart';
import 'translation_support.dart';
enum MessageStatus { pending, sent, delivered, failed }
@@ -36,6 +38,7 @@ class Message {
final bool isOutgoing;
final bool isBookmarked;
final bool isCli;
final bool isSmazCompressed;
final MessageStatus status;
final String? originalText;
final String? translatedText;
@@ -65,6 +68,7 @@ class Message {
required this.isOutgoing,
this.isBookmarked = false,
this.isCli = false,
this.isSmazCompressed = false,
this.status = MessageStatus.pending,
String? messageId,
this.originalText,
@@ -110,6 +114,7 @@ class Message {
int? pathLength,
Uint8List? pathBytes,
bool? isCli,
bool? isSmazCompressed,
bool? isBookmarked,
Object? originalText = _unset,
Object? translatedText = _unset,
@@ -128,6 +133,7 @@ class Message {
isOutgoing: isOutgoing,
isBookmarked: isBookmarked ?? this.isBookmarked,
isCli: isCli ?? this.isCli,
isSmazCompressed: isSmazCompressed ?? this.isSmazCompressed,
status: status ?? this.status,
messageId: messageId,
originalText: originalText == _unset
@@ -173,7 +179,9 @@ class Message {
if ((flags >> 2) != txtTypePlain) {
return null;
}
final text = reader.readCString();
final rawText = reader.readCString();
final smazDecoded = Smaz.tryDecodePrefixed(rawText);
final text = smazDecoded ?? rawText;
return Message(
senderKey: senderKey,
@@ -182,6 +190,7 @@ class Message {
receivedAt: DateTime.now(),
isOutgoing: false,
isCli: false,
isSmazCompressed: smazDecoded != null,
status: MessageStatus.delivered,
pathBytes: Uint8List(0),
);
@@ -198,6 +207,7 @@ class Message {
String? translationModelId,
int? pathLength,
Uint8List? pathBytes,
bool isSmazCompressed = false,
}) {
return Message(
senderKey: recipientKey,
@@ -208,6 +218,7 @@ class Message {
timestamp: DateTime.now(),
isOutgoing: true,
isCli: false,
isSmazCompressed: isSmazCompressed,
status: MessageStatus.pending,
pathLength: pathLength,
pathBytes: pathBytes,