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:
parent
4e63566dbf
commit
c5db30d0c4
@ -28,14 +28,14 @@ module.exports = function(RED) {
|
|||||||
this.username = credentials.user;
|
this.username = credentials.user;
|
||||||
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"},
|
||||||
password: {type: "password"}
|
password: {type: "password"}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function XmppInNode(n) {
|
function XmppInNode(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
@ -116,11 +116,12 @@ 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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("xmpp in",XmppInNode);
|
RED.nodes.registerType("xmpp in",XmppInNode);
|
||||||
|
|
||||||
function XmppOutNode(n) {
|
function XmppOutNode(n) {
|
||||||
@ -203,10 +204,11 @@ 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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("xmpp out",XmppOutNode);
|
RED.nodes.registerType("xmpp out",XmppOutNode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user