mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
improve xmpp presence detections
This commit is contained in:
parent
cf310adb07
commit
14a8b3293b
@ -502,6 +502,7 @@ module.exports = function(RED) {
|
|||||||
// ignore 404 error
|
// ignore 404 error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var state = stanza.getChild('show');
|
var state = stanza.getChild('show');
|
||||||
@ -513,12 +514,17 @@ module.exports = function(RED) {
|
|||||||
statusText = "offline";
|
statusText = "offline";
|
||||||
state = "offline";
|
state = "offline";
|
||||||
}
|
}
|
||||||
var status = stanza.getChild('status');
|
else {
|
||||||
if (typeof status !== "undefined") {
|
statusText = "online";
|
||||||
statusText = status.getText();
|
state = "online";
|
||||||
}
|
}
|
||||||
// right, do we care if there's no status?
|
|
||||||
if (statusText !== "") {
|
var status = stanza.getChild('status');
|
||||||
|
if (status !== undefined) {
|
||||||
|
statusText = status.getText() || "online";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusText !== "" && (stanza.attrs.from !== stanza.attrs.to)) {
|
||||||
var from = stanza.attrs.from;
|
var from = stanza.attrs.from;
|
||||||
var msg = {
|
var msg = {
|
||||||
topic:from,
|
topic:from,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-xmpp",
|
"name": "node-red-node-xmpp",
|
||||||
"version": "0.5.4",
|
"version": "0.5.5",
|
||||||
"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"
|
||||||
|
Loading…
Reference in New Issue
Block a user