mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 10:16:11 +00:00
fix(prefs): use magic sentinel to validate page_order
Previously page_order_set status was inferred from page_order[0] being
in 1..11, so a single junk byte in that range falsely triggered
custom-order mode. Add explicit page_order_set magic (0xA5) written
alongside the array; pre-magic saves are migrated once on load when
their first byte still passes the legacy range check.
Also fix(ui): keep "@[nick] " prefix out of placeholder expansion in
QuickMsgScreen reply path, so a nick containing a token like {loc}
isn't substituted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
10b2629b36
commit
e2d59b9a3d
@@ -203,7 +203,7 @@ class HomeScreen : public UIScreen {
|
||||
// Returns count; out[] receives HomePage enum values.
|
||||
int buildVisibleOrder(int* out) const {
|
||||
int n = 0;
|
||||
bool custom = _node_prefs && _node_prefs->page_order[0] >= 1 && _node_prefs->page_order[0] <= 11;
|
||||
bool custom = _node_prefs && _node_prefs->page_order_set == NodePrefs::PAGE_ORDER_MAGIC;
|
||||
if (custom) {
|
||||
for (int i = 0; i < 11; i++) {
|
||||
uint8_t v = _node_prefs->page_order[i];
|
||||
|
||||
Reference in New Issue
Block a user