mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into adding-timeout-to-functio-node
This commit is contained in:
@@ -35,7 +35,11 @@ module.exports = function(RED) {
|
||||
}
|
||||
else { node.previous = {}; }
|
||||
}
|
||||
var value = RED.util.getMessageProperty(msg,node.property);
|
||||
var value;
|
||||
try {
|
||||
value = RED.util.getMessageProperty(msg,node.property);
|
||||
}
|
||||
catch(e) { }
|
||||
if (value !== undefined) {
|
||||
var t = "_no_topic";
|
||||
if (node.septopics) { t = topic || t; }
|
||||
|
@@ -697,7 +697,8 @@ module.exports = function(RED) {
|
||||
node.options.rejectUnauthorized = (node.verifyservercert == "true" || node.verifyservercert === true);
|
||||
}
|
||||
}
|
||||
|
||||
node.v5 = () => node.options && node.options.protocolVersion == 5
|
||||
node.subscriptionIdentifiersAvailable = () => node.v5() && node.serverProperties && node.serverProperties.subscriptionIdentifiersAvailable
|
||||
n.autoConnect = n.autoConnect === "false" || n.autoConnect === false ? false : true;
|
||||
node.setOptions(n, true);
|
||||
|
||||
@@ -920,7 +921,12 @@ module.exports = function(RED) {
|
||||
};
|
||||
node.subscriptions[topic][ref] = sub;
|
||||
if (node.connected) {
|
||||
const subIdsAvailable = node.subscriptionIdentifiersAvailable()
|
||||
node._clientOn('message',sub.handler);
|
||||
// if the broker doesn't support subscription identifiers (e.g. AWS core), then don't send them
|
||||
if (options.properties && options.properties.subscriptionIdentifier && subIdsAvailable !== true) {
|
||||
delete options.properties.subscriptionIdentifier
|
||||
}
|
||||
node.client.subscribe(topic, options);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user