mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	Bugfix: backward compatible node.topic has prio + Docs: added info about msg.topic in ACK node docs
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							04fee39a5a
						
					
				
				
					commit
					5fc7d873d9
				
			| @@ -197,6 +197,7 @@ | ||||
|     <p> | ||||
|         The node allows for following inputs: | ||||
|         <ul> | ||||
|             <li><code>msg.topic</code>The topic to which the message should be acknowledged, if the <b>Destionation</b> field is set the msg.topic will be overwritten by this value</li> | ||||
|             <li><code>msg.messageId</code>: The id of the message to acknowledge</li> | ||||
|             <li><code>msg.transaction</code>: Optional transaction name</li> | ||||
|         </ul> | ||||
|   | ||||
| @@ -420,7 +420,7 @@ module.exports = function(RED) { | ||||
|             setStatusDisconnected(node); | ||||
|  | ||||
|             node.on("input", function(msg, send, done) { | ||||
|                 const topic = msg.topic || node.topic; | ||||
|                 const topic = node.topic || msg.topic; | ||||
|                 if (topic.length > 0 && msg.payload) { | ||||
|                     try { | ||||
|                         msg.payload = JSON.stringify(msg.payload); | ||||
| @@ -469,7 +469,7 @@ module.exports = function(RED) { | ||||
|             setStatusDisconnected(node); | ||||
|  | ||||
|             node.on("input", function(msg, send, done) { | ||||
|                 const topic = msg.topic || node.topic; | ||||
|                 const topic = node.topic || msg.topic; | ||||
|                 if (topic.length > 0) { | ||||
|                     node.serverConnection.ack(topic, msg.messageId, msg.transaction); | ||||
|                 } else if (!topic.length > 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user