mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-02 03:56:47 +00:00
commit
303396dfc3
@ -39,7 +39,7 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length)
|
|||||||
if (err.empty()) {
|
if (err.empty()) {
|
||||||
DEBUG_MSG("JSON Received on MQTT, parsing..\n");
|
DEBUG_MSG("JSON Received on MQTT, parsing..\n");
|
||||||
// check if it is a valid envelope
|
// check if it is a valid envelope
|
||||||
if (json.object_items().count("sender") != 0 && json.object_items().count("payload") != 0) {
|
if (json.object_items().count("sender") != 0 && json.object_items().count("payload") != 0 && json["type"].string_value().compare("sendtext") == 0) {
|
||||||
// this is a valid envelope
|
// this is a valid envelope
|
||||||
if (json["sender"].string_value().compare(owner.id) != 0) {
|
if (json["sender"].string_value().compare(owner.id) != 0) {
|
||||||
std::string jsonPayloadStr = json["payload"].dump();
|
std::string jsonPayloadStr = json["payload"].dump();
|
||||||
|
Loading…
Reference in New Issue
Block a user