code: function (attr) {
  		this.debug("STREAM: opened.");
  		this._setStatus(xmpp.Status.AUTHENTICATING);
  		var handshake = sha1.hex(attr.id + this.password);
  		this.debug("Calculated authentication token " + handshake
  			+ " from stream id '" + attr.id
  			+ "' and password '" + this.password + "'");
  		this.debug("Sending authentication token...");
  		this.send("<handshake>"+handshake+"</handshake>");
  	}
docs: Stream listeners, called on XMPP-level events