222 _stream_opened: function (attr) |
222 _stream_opened: function (attr) |
223 { |
223 { |
224 this.debug("STREAM: opened."); |
224 this.debug("STREAM: opened."); |
225 this._setStatus(xmpp.Status.AUTHENTICATING); |
225 this._setStatus(xmpp.Status.AUTHENTICATING); |
226 var handshake = sha1.hex(attr.id + this.password); |
226 var handshake = sha1.hex(attr.id + this.password); |
|
227 this.debug("Calculated authentication token " + handshake |
|
228 + " from stream id '" + attr.id |
|
229 + "' and password '" + this.password + "'"); |
227 this.debug("Sending authentication token..."); |
230 this.debug("Sending authentication token..."); |
228 this.debug("with id: '"+attr.id+"' and pass: '"+this.password+"'") |
|
229 this.send("<handshake>"+handshake+"</handshake>"); |
231 this.send("<handshake>"+handshake+"</handshake>"); |
230 }, |
232 }, |
231 |
233 |
232 _handle_stanza: function (stanza) |
234 _handle_stanza: function (stanza) |
233 { |
235 { |