1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Fix name filtering for incoming messages

to close #492
This commit is contained in:
Dave Conway-Jones 2021-05-08 12:01:55 +01:00
parent 263031d6c7
commit 93f6517d30
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 3 additions and 3 deletions

View File

@ -443,7 +443,7 @@ module.exports = function(RED) {
} }
else { msg.topic = ids[0]; } else { msg.topic = ids[0]; }
// if (RED.settings.verbose || LOGITALL) { node.log("Received a message from "+stanza.attrs.from); } // if (RED.settings.verbose || LOGITALL) { node.log("Received a message from "+stanza.attrs.from); }
if (!node.join && ((node.from[0] === "") || (node.from.includes(stanza.attrs.to)))) { if (!node.join && ((node.from[0] === "") || (node.from.includes(stanza.attrs.from.split('/')[0])) || (node.from.includes(stanza.attrs.from.split('/')[1])) )) {
node.send([msg,null]); node.send([msg,null]);
} }
} }
@ -514,7 +514,7 @@ module.exports = function(RED) {
payload: { payload: {
presence:state, presence:state,
status:statusText, status:statusText,
name:node.serverConfig.MUCs[stanza.attrs.from.split('/')[0]] name:stanza.attrs.from.split('/')[1]
} }
}; };
node.send([null,msg]); node.send([null,msg]);

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-xmpp", "name": "node-red-node-xmpp",
"version": "0.5.2", "version": "0.5.3",
"description": "A Node-RED node to talk to an XMPP server", "description": "A Node-RED node to talk to an XMPP server",
"dependencies": { "dependencies": {
"@xmpp/client": "^0.12.0" "@xmpp/client": "^0.12.0"