Update MQTT.cpp

pull/1823/head
Thomas Göttgens 2022-10-19 11:04:13 +02:00 zatwierdzone przez GitHub
rodzic 18ccb38824
commit 075a53ced0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -39,7 +39,7 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length)
if (err.empty()) {
DEBUG_MSG("JSON Received on MQTT, parsing..\n");
// check if it is a valid envelope
if (json.object_items().count("sender") != 0 && json.object_items().count("payload") != 0 && json["type"] == "sendtext") {
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
if (json["sender"].string_value().compare(owner.id) != 0) {
std::string jsonPayloadStr = json["payload"].dump();