function (elem)
    {
        if (this._sasl_data["server-signature"]) {
            var serverSignature;
            var success = Base64.decode(Strophe.getText(elem));
            var attribMatch = /([a-z]+)=([^,]+)(,|$)/;
            var matches = success.match(attribMatch);
            if (matches[1] == "v") {
                serverSignature = matches[2];
            }

            if (serverSignature != this._sasl_data["server-signature"]) {
              // remove old handlers
              this.deleteHandler(this._sasl_failure_handler);
              this._sasl_failure_handler = null;
              if (this._sasl_challenge_handler) {
                this.deleteHandler(this._sasl_challenge_handler);
                this._sasl_challenge_handler = null;
              }

              this._sasl_data = {};
              return this._sasl_failure_cb(null);
            }
        }

        Strophe.info("SASL authentication succeeded.");

        if(this._sasl_mechanism)
          this._sasl_mechanism.onSuccess();

        // remove old handlers
        this.deleteHandler(this._sasl_failure_handler);
        this._sasl_failure_handler = null;
        if (this._sasl_challenge_handler) {
            this.deleteHandler(this._sasl_challenge_handler);
            this._sasl_challenge_handler = null;
        }

        var streamfeature_handlers = [];
        var wrapper = function(handlers, elem) {
            while (handlers.length) {
                this.deleteHandler(handlers.pop());
            }
            this._sasl_auth1_cb.bind(this)(elem);
            return false;
        };
        streamfeature_handlers.push(this._addSysHandler(function(elem) {
            wrapper.bind(this)(streamfeature_handlers, elem);
        }.bind(this), null, "stream:features", null, null));
        streamfeature_handlers.push(this._addSysHandler(function(elem) {
            wrapper.bind(this)(streamfeature_handlers, elem);
        }.bind(this), Strophe.NS.STREAM, "features", null, null));

        // we must send an xmpp:restart now
        this._sendRestart();

        return false;
    }
function (elem)
    {
        if (this._sasl_data["server-signature"]) {
            var serverSignature;
            var success = Base64.decode(Strophe.getText(elem));
            var attribMatch = /([a-z]+)=([^,]+)(,|$)/;
            var matches = success.match(attribMatch);
            if (matches[1] == "v") {
                serverSignature = matches[2];
            }

            if (serverSignature != this._sasl_data["server-signature"]) {
              // remove old handlers
              this.deleteHandler(this._sasl_failure_handler);
              this._sasl_failure_handler = null;
              if (this._sasl_challenge_handler) {
                this.deleteHandler(this._sasl_challenge_handler);
                this._sasl_challenge_handler = null;
              }

              this._sasl_data = {};
              return this._sasl_failure_cb(null);
            }
        }

        Strophe.info("SASL authentication succeeded.");

        if(this._sasl_mechanism)
          this._sasl_mechanism.onSuccess();

        // remove old handlers
        this.deleteHandler(this._sasl_failure_handler);
        this._sasl_failure_handler = null;
        if (this._sasl_challenge_handler) {
            this.deleteHandler(this._sasl_challenge_handler);
            this._sasl_challenge_handler = null;
        }

        var streamfeature_handlers = [];
        var wrapper = function(handlers, elem) {
            while (handlers.length) {
                this.deleteHandler(handlers.pop());
            }
            this._sasl_auth1_cb.bind(this)(elem);
            return false;
        };
        streamfeature_handlers.push(this._addSysHandler(function(elem) {
            wrapper.bind(this)(streamfeature_handlers, elem);
        }.bind(this), null, "stream:features", null, null));
        streamfeature_handlers.push(this._addSysHandler(function(elem) {
            wrapper.bind(this)(streamfeature_handlers, elem);
        }.bind(this), Strophe.NS.STREAM, "features", null, null));

        // we must send an xmpp:restart now
        this._sendRestart();

        return false;
    }
function ( elem ) { if ( this . _sasl_data [ "server-signature" ] ) { var serverSignature ; var success = Base64 . decode ( Strophe . getText ( elem ) ) ; var attribMatch = / ([a-z]+)=([^,]+)(,|$) / ; var matches = success . match ( attribMatch ) ; if ( matches [ 1 ] == "v" ) { serverSignature = matches [ 2 ] ; } if ( serverSignature != this . _sasl_data [ "server-signature" ] ) { // remove old handlers
 this . deleteHandler ( this . _sasl_failure_handler ) ; this . _sasl_failure_handler = null ; if ( this . _sasl_challenge_handler ) { this . deleteHandler ( this . _sasl_challenge_handler ) ; this . _sasl_challenge_handler = null ; } this . _sasl_data = { } ; return this . _sasl_failure_cb ( null ) ; } } Strophe . info ( "SASL authentication succeeded." ) ; if ( this . _sasl_mechanism ) this . _sasl_mechanism . onSuccess ( ) ; // remove old handlers
 this . deleteHandler ( this . _sasl_failure_handler ) ; this . _sasl_failure_handler = null ; if ( this . _sasl_challenge_handler ) { this . deleteHandler ( this . _sasl_challenge_handler ) ; this . _sasl_challenge_handler = null ; } var streamfeature_handlers = [ ] ; var wrapper = function ( handlers , elem ) { while ( handlers . length ) { this . deleteHandler ( handlers . pop ( ) ) ; } this . _sasl_auth1_cb . bind ( this ) ( elem ) ; return false ; } ; streamfeature_handlers . push ( this . _addSysHandler ( function ( elem ) { wrapper . bind ( this ) ( streamfeature_handlers , elem ) ; } . bind ( this ) , null , "stream:features" , null , null ) ) ; streamfeature_handlers . push ( this . _addSysHandler ( function ( elem ) { wrapper . bind ( this ) ( streamfeature_handlers , elem ) ; } . bind ( this ) , Strophe . NS . STREAM , "features" , null , null ) ) ; // we must send an xmpp:restart now
 this . _sendRestart ( ) ; return false ; }
/* jshint unused:true PrivateFunction: _sasl_success_cb
_Private_ handler for succesful SASL authentication.

Parameters:
(XMLElement) elem - The matching stanza.

Returns:
false to remove the handler.
/ * jshint unused : true PrivateFunction : _sasl_success_cb _Private_ handler for succesful SASL authentication .
SASL authentication succeeded.