mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-16 10:02:05 +00:00
Skip favorite nodes when clearing out oldest in NodeDB (#3464)
* Skip favorite nodes when clearing out oldest in NodeDB * We should actually map between the types
This commit is contained in:
parent
a57f7730ea
commit
7aa013a716
@ -939,7 +939,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
|||||||
uint32_t oldest = UINT32_MAX;
|
uint32_t oldest = UINT32_MAX;
|
||||||
int oldestIndex = -1;
|
int oldestIndex = -1;
|
||||||
for (int i = 1; i < numMeshNodes; i++) {
|
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;
|
oldest = meshNodes->at(i).last_heard;
|
||||||
oldestIndex = i;
|
oldestIndex = i;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ meshtastic_NodeInfo TypeConversions::ConvertToNodeInfo(const meshtastic_NodeInfo
|
|||||||
info.channel = lite->channel;
|
info.channel = lite->channel;
|
||||||
info.via_mqtt = lite->via_mqtt;
|
info.via_mqtt = lite->via_mqtt;
|
||||||
info.hops_away = lite->hops_away;
|
info.hops_away = lite->hops_away;
|
||||||
|
info.is_favorite = lite->is_favorite;
|
||||||
|
|
||||||
if (lite->has_position) {
|
if (lite->has_position) {
|
||||||
info.has_position = true;
|
info.has_position = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user