update to zjs81/dev commit d5f54df

This commit is contained in:
ericz committed 2026-09-21 16:11:40 +02:00
commit cf027c974f
64 files changed
+2972 -1129

No files matched your search

+34 -5
View File
@@ -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,37 @@ 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, // won't be used for anything
emoji: emoji,
senderName: senderName,
hashType: HashType.ours, // also not used for anything
),
);
}
}
return reactionList;
}
}
+4 -4
View File
@@ -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,
}) {
+12 -2
View File
@@ -478,7 +478,17 @@ class RadioSettings {
bandwidth: LoRaBandwidth.bw62_5,
spreadingFactor: LoRaSpreadingFactor.sf9,
codingRate: LoRaCodingRate.cr4_8,
txPowerDbm: 20,
txPowerDbm: 22,
),
),
(
'USA Philly',
RadioSettings(
frequencyMHz: 902.250,
bandwidth: LoRaBandwidth.bw500,
spreadingFactor: LoRaSpreadingFactor.sf11,
codingRate: LoRaCodingRate.cr4_5,
txPowerDbm: 22,
),
),
(
@@ -488,7 +498,7 @@ class RadioSettings {
bandwidth: LoRaBandwidth.bw62_5,
spreadingFactor: LoRaSpreadingFactor.sf7,
codingRate: LoRaCodingRate.cr4_5,
txPowerDbm: 20,
txPowerDbm: 22,
),
),
(