fix(ui-orig): show hop count, not raw path_len, in message origin

The "(N)" origin readout printed the raw wire path_len. That byte packs the
path hash-size mode in its top 2 bits and the hop count in the low 6, so with
path_hash_mode >= 1 (2-byte hashes) it over-reported — e.g. "(66)" for a
2-hop message. Mask & 63 (getPathHashCount) so it shows the real hop count.

Affects the ui-orig variants only (ui-new/ui-tiny ignore the arg).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-07-05 22:21:31 +02:00
parent 399b61e2bb
commit 046c2f258e

View File

@@ -134,7 +134,7 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i
if (path_len == 0xFF) {
sprintf(_origin, "(F) %s", from_name);
} else {
sprintf(_origin, "(%d) %s", (uint32_t) path_len, from_name);
sprintf(_origin, "(%d) %s", (uint32_t)(path_len & 63), from_name); // low 6 bits = hop count; high 2 bits are the path hash-size mode
}
StrHelper::strncpy(_msg, text, sizeof(_msg));