From 10141b2562a6620da32b98d82b998e741acdc466 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 16 Oct 2025 12:08:00 -0500 Subject: [PATCH] InkHUD: don't try to access meshNodes directly --- .../InkHUD/Applets/User/Heard/HeardApplet.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp b/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp index 5a659c606..aeaa78cda 100644 --- a/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.cpp @@ -62,22 +62,12 @@ void InkHUD::HeardApplet::populateFromNodeDB() { // Fill a collection with pointers to each node in db std::vector ordered; - for (auto mn = nodeDB->meshNodes->begin(); mn != nodeDB->meshNodes->end(); ++mn) { - // Only copy if valid, and not our own node + for (int i = 1; i < maxCards(); i++) { + auto mn = nodeDB->getMeshNodeByIndex(i); if (mn->num != 0 && mn->num != nodeDB->getNodeNum()) ordered.push_back(&*mn); } - // Sort the collection by age - std::sort(ordered.begin(), ordered.end(), [](meshtastic_NodeInfoLite *top, meshtastic_NodeInfoLite *bottom) -> bool { - return (top->last_heard > bottom->last_heard); - }); - - // Keep the most recent entries only - // Just enough to fill the screen - if (ordered.size() > maxCards()) - ordered.resize(maxCards()); - // Create card info for these (stale) node observations meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); for (meshtastic_NodeInfoLite *node : ordered) {