From ff2cad9cac4fa9eaa7a1ffdd6668b4fdaa4793d1 Mon Sep 17 00:00:00 2001 From: Joshua Pirihi Date: Sat, 29 Jan 2022 06:06:49 +1300 Subject: [PATCH] Allow publishing of decrypted mqtt packets --- src/mesh/Router.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 0ac62802c..babd74393 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -232,7 +232,7 @@ ErrorCode Router::send(MeshPacket *p) DEBUG_MSG("Should encrypt MQTT?: %d\n", shouldActuallyEncrypt); - //do not decrypt packets if the user hasn't set a custom mqtt server + //the packet is currently in a decrypted state. send it now if they want decrypted packets if (mqtt && !shouldActuallyEncrypt) mqtt->onSend(*p, chIndex); #endif @@ -244,6 +244,7 @@ ErrorCode Router::send(MeshPacket *p) } #if defined(HAS_WIFI) || defined(PORTDUINO) + //the packet is now encrypted. //check if we should send encrypted packets to mqtt if (mqtt && shouldActuallyEncrypt) mqtt->onSend(*p, chIndex);