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

Tidy up xmpp node formatting

(diff looks awful… it isn’t really)
This commit is contained in:
Dave Conway-Jones 2015-09-24 18:58:24 +01:00
parent 4e63566dbf
commit c5db30d0c4
2 changed files with 166 additions and 164 deletions

View File

@ -28,14 +28,14 @@ module.exports = function(RED) {
this.username = credentials.user;
this.password = credentials.password;
}
}
}
RED.nodes.registerType("xmpp-server",XMPPServerNode,{
credentials: {
user: {type:"text"},
password: {type: "password"}
}
});
});
function XmppInNode(n) {
RED.nodes.createNode(this,n);
@ -116,11 +116,12 @@ module.exports = function(RED) {
node.on("close", function(done) {
//xmpp.setPresence('offline');
xmpp.disconnect();
if (xmpp.conn) { xmpp.conn.end(); }
xmpp = null;
done();
});
}
}
RED.nodes.registerType("xmpp in",XmppInNode);
function XmppOutNode(n) {
@ -203,10 +204,11 @@ module.exports = function(RED) {
node.on("close", function() {
xmpp.setPresence('offline');
xmpp.disconnect();
if (xmpp.conn) { xmpp.conn.end(); }
xmpp = null;
});
}
}
RED.nodes.registerType("xmpp out",XmppOutNode);
}

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-xmpp",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "A Node-RED node to talk to an XMPP server",
"dependencies" : {
"simple-xmpp" : "0.1.92"