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

@ -29,6 +29,7 @@ module.exports = function(RED) {
this.password = credentials.password; this.password = credentials.password;
} }
} }
RED.nodes.registerType("xmpp-server",XMPPServerNode,{ RED.nodes.registerType("xmpp-server",XMPPServerNode,{
credentials: { credentials: {
user: {type:"text"}, user: {type:"text"},
@ -36,7 +37,6 @@ module.exports = function(RED) {
} }
}); });
function XmppInNode(n) { function XmppInNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.server = n.server; this.server = n.server;
@ -116,6 +116,7 @@ module.exports = function(RED) {
node.on("close", function(done) { node.on("close", function(done) {
//xmpp.setPresence('offline'); //xmpp.setPresence('offline');
xmpp.disconnect();
if (xmpp.conn) { xmpp.conn.end(); } if (xmpp.conn) { xmpp.conn.end(); }
xmpp = null; xmpp = null;
done(); done();
@ -203,6 +204,7 @@ module.exports = function(RED) {
node.on("close", function() { node.on("close", function() {
xmpp.setPresence('offline'); xmpp.setPresence('offline');
xmpp.disconnect();
if (xmpp.conn) { xmpp.conn.end(); } if (xmpp.conn) { xmpp.conn.end(); }
xmpp = null; xmpp = null;
}); });

View File

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