mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
suppress warning from underlying xmpp library - missing stringprep is unlikely to cause a problem unless using higher utf8 codes, but it doesn't compile at present so more trouble for users than it's worth.
This commit is contained in:
parent
8a6b9cbf13
commit
c7bbfeeb7c
@ -14,8 +14,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
var orig=console.warn;
|
||||||
|
console.warn=(function() { // suppress warning from stringprep when not needed)
|
||||||
|
var orig=console.warn;
|
||||||
|
return function() {
|
||||||
|
//orig.apply(console, arguments);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
var RED = require("../../red/red");
|
var RED = require("../../red/red");
|
||||||
var xmpp = require('simple-xmpp');
|
var xmpp = require('simple-xmpp');
|
||||||
|
console.warn = orig;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var xmppkey = require("../../settings").xmpp || require("../../../xmppkeys.js");
|
var xmppkey = require("../../settings").xmpp || require("../../../xmppkeys.js");
|
||||||
@ -97,17 +106,13 @@ function XmppNode(n) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this._close = function() {
|
this.on("close", function() {
|
||||||
xmpp.setPresence('offline');
|
xmpp.setPresence('offline');
|
||||||
//xmpp.conn.end();
|
//xmpp.conn.end();
|
||||||
// TODO - DCJ NOTE... this is not good. It leaves the connection up over a restart - which will end up with bad things happening...
|
// TODO - DCJ NOTE... this is not good. It leaves the connection up over a restart - which will end up with bad things happening...
|
||||||
// (but requires the underlying xmpp lib to be fixed (which does have an open bug request on fixing the close method)).
|
// (but requires the underlying xmpp lib to be fixed (which does have an open bug request on fixing the close method)).
|
||||||
this.warn("Due to an underlying bug in the xmpp library this does not disconnect old sessions. This is bad... A restart would be better.");
|
this.warn("Due to an underlying bug in the xmpp library this does not disconnect old sessions. This is bad... A restart would be better.");
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RED.nodes.registerType("xmpp",XmppNode);
|
RED.nodes.registerType("xmpp",XmppNode);
|
||||||
|
|
||||||
XmppNode.prototype.close = function() {
|
|
||||||
this._close();
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user