Merge pull request #1356 from mcqn/fix-bug-with-mqtt-group-topics

Fix bug where messages sent to the group topic were incorrectly ignored
This commit is contained in:
Aircoookie 2020-11-19 11:47:47 +01:00 committed by GitHub
commit 7f9da22626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties
if (strncmp(topic, mqttDeviceTopic, topicPrefixLen) == 0) {
topic += topicPrefixLen;
} else {
size_t topic_prefix_len = strlen(mqttGroupTopic);
topicPrefixLen = strlen(mqttGroupTopic);
if (strncmp(topic, mqttGroupTopic, topicPrefixLen) == 0) {
topic += topicPrefixLen;
} else {