mirror of https://github.com/node-red/node-red.git
Ensure userProps makes it through to runtime
parent
662a44fccf
commit
294fc6b62f
|
@ -480,6 +480,7 @@
|
|||
willRetain: {value:false},
|
||||
willPayload: {value:""},
|
||||
willMsg: { value: {}},
|
||||
userProps: { value: ""},
|
||||
sessionExpiry: {value:0}
|
||||
},
|
||||
credentials: {
|
||||
|
@ -719,9 +720,13 @@
|
|||
}
|
||||
|
||||
if (v5) {
|
||||
const userProps = $("#node-config-input-userProps").val().trim();
|
||||
if (userProps) {
|
||||
this.userProps = userProps;
|
||||
this.userProps = "";
|
||||
const userPropsType = $("#node-config-input-userProps").typedInput("type");
|
||||
if(userPropsType == "json") {
|
||||
const userProps = $("#node-config-input-userProps").val();
|
||||
if (userProps && typeof userProps === "string") {
|
||||
this.userProps = userProps.trim();
|
||||
}
|
||||
}
|
||||
this.birthMsg = saveV5Message("birth");
|
||||
this.closeMsg = saveV5Message("close");
|
||||
|
|
|
@ -415,8 +415,12 @@ module.exports = function(RED) {
|
|||
setIfHasProperty(opts, node, "topicAliasMaximum", init);
|
||||
setIfHasProperty(opts, node, "maximumPacketSize", init);
|
||||
setIfHasProperty(opts, node, "receiveMaximum", init);
|
||||
setIfHasProperty(opts, node, "userProperties", init);//https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901116
|
||||
setIfHasProperty(opts, node, "userPropertiesType", init);
|
||||
//https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901116
|
||||
if (hasProperty(opts, "userProperties")) {
|
||||
node.userProperties = opts.userProperties;
|
||||
} else if (hasProperty(opts, "userProps")) {
|
||||
node.userProperties = opts.userProps;
|
||||
}
|
||||
|
||||
function createLWT(topic, payload, qos, retain, v5opts, v5SubPropName) {
|
||||
let message = undefined;
|
||||
|
|
Loading…
Reference in New Issue