From 305327faaa650c2cee9e428ecf4e45d972de7d7b Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 14 Jun 2024 16:39:04 +0100 Subject: [PATCH] better handle xmpp stanza type being optional to close #1071 --- social/xmpp/92-xmpp.js | 2 +- social/xmpp/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/social/xmpp/92-xmpp.js b/social/xmpp/92-xmpp.js index 160562b3..33d2f917 100644 --- a/social/xmpp/92-xmpp.js +++ b/social/xmpp/92-xmpp.js @@ -444,7 +444,7 @@ module.exports = function(RED) { subj = subj.getText(); if (subj.trim() !== "") { node.subject[stanza.attrs.from.split('/')[0]] = subj; } } - if (stanza.attrs.type == 'chat') { + if (!stanza.attrs.hasOwnProperty("type") || stanza.attrs.type == 'chat') { var body = stanza.getChild('body'); if (body) { var msg = { payload:body.getText(), subject:node.subject[stanza.attrs.from.split('/')[0]] }; diff --git a/social/xmpp/package.json b/social/xmpp/package.json index 9a8f5c0c..734d9529 100644 --- a/social/xmpp/package.json +++ b/social/xmpp/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-xmpp", - "version": "0.6.2", + "version": "0.6.3", "description": "A Node-RED node to talk to an XMPP server", "dependencies": { "@xmpp/client": "^0.13.1"