just for good measure, correct json type field

pull/1823/head
Thomas Göttgens 2022-10-19 10:58:46 +02:00
rodzic 7c3dc076d2
commit c97831963b
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -42,6 +42,7 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length)
if (json.object_items().count("sender") != 0 && json.object_items().count("payload") != 0 && json["type"] == "sendtext") {
// this is a valid envelope
if (json["sender"].string_value().compare(owner.id) != 0) {
json["type"] = "text";
std::string jsonPayloadStr = json["payload"].dump();
DEBUG_MSG("JSON payload %s, length %u\n", jsonPayloadStr.c_str(), jsonPayloadStr.length());