From cfb6a1394c77d99addd6b6d7466e76347b0b97d1 Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Tue, 5 Sep 2023 19:56:42 +0200 Subject: [PATCH] Only update neighbors when module is enabled --- src/modules/NeighborInfoModule.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/NeighborInfoModule.cpp b/src/modules/NeighborInfoModule.cpp index a0e9843ed..a58525de4 100644 --- a/src/modules/NeighborInfoModule.cpp +++ b/src/modules/NeighborInfoModule.cpp @@ -203,8 +203,10 @@ Pass it to an upper client; do not persist this data on the mesh */ bool NeighborInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_NeighborInfo *np) { - printNeighborInfo("RECEIVED", np); - updateNeighbors(mp, np); + if (enabled) { + printNeighborInfo("RECEIVED", np); + updateNeighbors(mp, np); + } // Allow others to handle this packet return false; } @@ -307,4 +309,4 @@ bool NeighborInfoModule::saveProtoForModule() okay &= nodeDB.saveProto(neighborInfoConfigFile, meshtastic_NeighborInfo_size, &meshtastic_NeighborInfo_msg, &neighborState); return okay; -} \ No newline at end of file +}