updated ui added new features

This commit is contained in:
zach
2025-12-27 15:32:32 -07:00
parent 02ca7801ea
commit a2cfae3a22
589 changed files with 181780 additions and 569 deletions
+4
View File
@@ -65,6 +65,7 @@ class ChannelMessageStore {
'repeatCount': msg.repeatCount,
'pathLength': msg.pathLength,
'pathBytes': base64Encode(msg.pathBytes),
'pathVariants': msg.pathVariants.map(base64Encode).toList(),
'repeats': msg.repeats.map(_repeatToJson).toList(),
};
}
@@ -87,6 +88,9 @@ class ChannelMessageStore {
pathBytes: json['pathBytes'] != null
? Uint8List.fromList(base64Decode(json['pathBytes'] as String))
: Uint8List(0),
pathVariants: (json['pathVariants'] as List<dynamic>?)
?.map((entry) => Uint8List.fromList(base64Decode(entry as String)))
.toList(),
repeats: (json['repeats'] as List<dynamic>?)
?.map((entry) => _repeatFromJson(entry as Map<String, dynamic>))
.toList() ??
+5 -1
View File
@@ -37,10 +37,13 @@ class ContactStore {
'latitude': contact.latitude,
'longitude': contact.longitude,
'lastSeen': contact.lastSeen.millisecondsSinceEpoch,
'lastMessageAt': contact.lastMessageAt.millisecondsSinceEpoch,
};
}
Contact _fromJson(Map<String, dynamic> json) {
final lastSeenMs = json['lastSeen'] as int? ?? 0;
final lastMessageMs = json['lastMessageAt'] as int?;
return Contact(
publicKey: Uint8List.fromList(base64Decode(json['publicKey'] as String)),
name: json['name'] as String? ?? 'Unknown',
@@ -51,7 +54,8 @@ class ContactStore {
: Uint8List(0),
latitude: (json['latitude'] as num?)?.toDouble(),
longitude: (json['longitude'] as num?)?.toDouble(),
lastSeen: DateTime.fromMillisecondsSinceEpoch(json['lastSeen'] as int? ?? 0),
lastSeen: DateTime.fromMillisecondsSinceEpoch(lastSeenMs),
lastMessageAt: DateTime.fromMillisecondsSinceEpoch(lastMessageMs ?? lastSeenMs),
);
}
}
+8
View File
@@ -41,6 +41,10 @@ class MessageStore {
'timestamp': msg.timestamp.millisecondsSinceEpoch,
'isOutgoing': msg.isOutgoing,
'isCli': msg.isCli,
'isVoice': msg.isVoice,
'voicePath': msg.voicePath,
'voiceDurationMs': msg.voiceDurationMs,
'voiceCodec': msg.voiceCodec,
'status': msg.status.index,
'messageId': msg.messageId,
'retryCount': msg.retryCount,
@@ -65,6 +69,10 @@ class MessageStore {
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] as int),
isOutgoing: json['isOutgoing'] as bool,
isCli: isCli,
isVoice: json['isVoice'] as bool? ?? false,
voicePath: json['voicePath'] as String?,
voiceDurationMs: json['voiceDurationMs'] as int?,
voiceCodec: json['voiceCodec'] as String?,
status: MessageStatus.values[json['status'] as int],
messageId: json['messageId'] as String?,
retryCount: json['retryCount'] as int? ?? 0,