From 93f6517d30c925457caa60bd0d399c3d9ac46740 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 8 May 2021 12:01:55 +0100 Subject: [PATCH] Fix name filtering for incoming messages to close #492 --- social/xmpp/92-xmpp.js | 4 ++-- social/xmpp/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/social/xmpp/92-xmpp.js b/social/xmpp/92-xmpp.js index da988f11..961ed178 100644 --- a/social/xmpp/92-xmpp.js +++ b/social/xmpp/92-xmpp.js @@ -443,7 +443,7 @@ module.exports = function(RED) { } else { msg.topic = ids[0]; } // 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]); } } @@ -514,7 +514,7 @@ module.exports = function(RED) { payload: { presence:state, status:statusText, - name:node.serverConfig.MUCs[stanza.attrs.from.split('/')[0]] + name:stanza.attrs.from.split('/')[1] } }; node.send([null,msg]); diff --git a/social/xmpp/package.json b/social/xmpp/package.json index 0a303abf..169d2f8b 100644 --- a/social/xmpp/package.json +++ b/social/xmpp/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-xmpp", - "version": "0.5.2", + "version": "0.5.3", "description": "A Node-RED node to talk to an XMPP server", "dependencies": { "@xmpp/client": "^0.12.0"