[Pkg-javascript-commits] [ltx] 49/469: added authenticated state reset, so online event is correctly triggered when reconnecting

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:00:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 93d5d6b87eae2ff9e58137a7e60dd8f21694598e
Author: danielzzz <daniel at zelisko.net>
Date:   Wed Aug 11 11:36:10 2010 +0200

    added authenticated state reset, so online event is correctly triggered when reconnecting
---
 lib/xmpp/component.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/xmpp/component.js b/lib/xmpp/component.js
index c14e29b..76baf53 100644
--- a/lib/xmpp/component.js
+++ b/lib/xmpp/component.js
@@ -25,6 +25,7 @@ function Component(params) {
     this.streamTo = this.jid.domain;
     this.addListener('streamStart', this.onStreamStart);
     this.addListener('rawStanza', this.onRawStanza);
+    this.addListener('end', this.onEnd);
 
     this.connect(params.port, params.host);
 }
@@ -32,6 +33,10 @@ function Component(params) {
 sys.inherits(Component, Connection.Connection);
 exports.Component = Component;
 
+Component.prototype.onEnd = function() {
+    this.authenticated = false;
+};
+
 Component.prototype.onStreamStart = function(streamAttrs) {
     var digest = sha1_hex(streamAttrs.id + this.password);
     this.send(new xml.Element('handshake').t(digest));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list