Add localhost exception for dontMqttMeBro (#5023)

This commit is contained in:
Jonathan Bennett 2024-10-10 14:06:47 -05:00 committed by GitHub
parent 1b04d41b9a
commit f82585d9b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -544,7 +544,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &
}
// check for the lowest bit of the data bitfield set false, and the use of one of the default keys.
if (!isFromUs(&mp_decoded) && mp_decoded.decoded.has_bitfield &&
if (!isFromUs(&mp_decoded) && strcmp(moduleConfig.mqtt.address, "127.0.0.1") != 0 && mp_decoded.decoded.has_bitfield &&
!(mp_decoded.decoded.bitfield & BITFIELD_OK_TO_MQTT_MASK) &&
(ch.settings.psk.size < 2 || (ch.settings.psk.size == 16 && memcmp(ch.settings.psk.bytes, defaultpsk, 16)) ||
(ch.settings.psk.size == 32 && memcmp(ch.settings.psk.bytes, eventpsk, 32)))) {