mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added manual device events, fixed MQTT publish filter.
This commit is contained in:
parent
1dc81b6c38
commit
4932d7961f
5 changed files with 44 additions and 3 deletions
|
@ -126,8 +126,8 @@ module.exports.CreateMQTTBroker = function (parent, db, args) {
|
|||
if (clients == null) return;
|
||||
if (typeof message == 'string') { message = new Buffer(message); }
|
||||
for (var i in clients) {
|
||||
// if (clients[i].subscriptions[topic] != null) { } // Add this if we only want to send subscribed topics.
|
||||
clients[i].publish({ cmd: 'publish', qos: 0, topic: topic, payload: message, retain: false });
|
||||
// Only publish to client that subscribe to the topic
|
||||
if (clients[i].subscriptions[topic] != null) { clients[i].publish({ cmd: 'publish', qos: 0, topic: topic, payload: message, retain: false }); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue