Merge pull request #1 from ericszimmermann/ez_snr_multibyte2

Multibyte Support for SNR-Indicator, channel message_bubble and Setting
This commit is contained in:
PacoX
2026-05-19 10:14:03 +02:00
committed by GitHub
47 changed files with 438 additions and 119 deletions
+12 -14
View File
@@ -15,7 +15,10 @@ class PathHelper {
.join();
}
static List<Uint8List> splitPathBytes(List<int> pathBytes, int hashByteWidth) {
static List<Uint8List> splitPathBytes(
List<int> pathBytes,
int hashByteWidth,
) {
if (pathBytes.isEmpty) return const [];
final width = hashByteWidth.clamp(1, 4);
@@ -50,18 +53,13 @@ class PathHelper {
final hex = formatHopHex(hopBytes);
// Find matching contacts by comparing public key prefix
final matches = allContacts
.where((c) {
if (c.publicKey.length < hopBytes.length) return false;
if (c.type != advTypeRepeater && c.type != advTypeRoom) return false;
// Compare bytes using listEquals for multi-byte support
return listEquals(
c.publicKey.sublist(0, hopBytes.length),
hopBytes,
);
})
.toList();
final matches = allContacts.where((c) {
if (c.publicKey.length < hopBytes.length) return false;
if (c.type != advTypeRepeater && c.type != advTypeRoom) return false;
// Compare bytes using listEquals for multi-byte support
return listEquals(c.publicKey.sublist(0, hopBytes.length), hopBytes);
}).toList();
if (matches.isEmpty) {
parts.add(hex);
} else if (matches.length == 1) {
@@ -70,7 +68,7 @@ class PathHelper {
parts.add(matches.map((c) => c.name).join(' | '));
}
}
return parts.join(' \u2192 ');
}
}