From b31146f62fc275bfd7e258e0ea40928d166443ba Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 21 Mar 2024 18:57:48 -0500 Subject: [PATCH 1/2] Skip favorite nodes when clearing out oldest in NodeDB --- src/mesh/NodeDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 80b46a4268..f65fe0da35 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -939,7 +939,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n) uint32_t oldest = UINT32_MAX; int oldestIndex = -1; for (int i = 1; i < numMeshNodes; i++) { - if (meshNodes->at(i).last_heard < oldest) { + if (!meshNodes->at(i).is_favorite && meshNodes->at(i).last_heard < oldest) { oldest = meshNodes->at(i).last_heard; oldestIndex = i; } From 0ca6a2368d0afab03d04282afa10e0aaacb8052e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 21 Mar 2024 19:06:26 -0500 Subject: [PATCH 2/2] We should actually map between the types --- src/mesh/TypeConversions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesh/TypeConversions.cpp b/src/mesh/TypeConversions.cpp index 20b1cb31ef..bcd600f242 100644 --- a/src/mesh/TypeConversions.cpp +++ b/src/mesh/TypeConversions.cpp @@ -12,6 +12,7 @@ meshtastic_NodeInfo TypeConversions::ConvertToNodeInfo(const meshtastic_NodeInfo info.channel = lite->channel; info.via_mqtt = lite->via_mqtt; info.hops_away = lite->hops_away; + info.is_favorite = lite->is_favorite; if (lite->has_position) { info.has_position = true;