B2G/gaia/apps/email/js/ext/mailapi/composite/configurator.js
/**
   * Define an account now that we have verified the credentials are good and
   * the server meets our minimal functionality standards.  We are also
   * provided with the protocol connection that was used to perform the check
   * so we can immediately put it to work.
   */
Define an account now that we have verified the credentials are good and
the server meets our minimal functionality standards.  We are also
provided with the protocol connection that was used to perform the check
so we can immediately put it to work.
Define an account now that we have verified the credentials are good and the server meets our minimal functionality standards . We are also provided with the protocol connection that was used to perform the check so we can immediately put it to work .
function cfg_is__defineImapAccount(
                        universe,
                        userDetails, credentials, imapConnInfo, smtpConnInfo,
                        imapProtoConn, tzOffset, callback) {
    var accountId = $a64.encodeInt(universe.config.nextAccountNum++);
    var accountDef = {
      id: accountId,
      name: userDetails.accountName || userDetails.emailAddress,
      defaultPriority: $date.NOW(),
      type: 'imap+smtp',
      receiveType: 'imap',
      sendType: 'smtp',
      syncRange: 'auto',
      credentials: credentials,
      receiveConnInfo: imapConnInfo,
      sendConnInfo: smtpConnInfo,
      identities: [
        {
          id: accountId + '/' +
                $a64.encodeInt(universe.config.nextIdentityNum++),
          name: userDetails.displayName,
          address: userDetails.emailAddress,
          replyTo: null,
          signature: null
        },
      ],
      tzOffset: tzOffset,
    };
    this._loadAccount(universe, accountDef, null,
                      imapProtoConn, function (account) {
      callback(null, account, null);
    });
  }
function cfg_is__defineImapAccount ( universe , userDetails , credentials , imapConnInfo , smtpConnInfo , imapProtoConn , tzOffset , callback ) { var accountId = $a64 . encodeInt ( universe . config . nextAccountNum ++ ) ; var accountDef = { id : accountId , name : userDetails . accountName || userDetails . emailAddress , defaultPriority : $date . NOW ( ) , type : 'imap+smtp' , receiveType : 'imap' , sendType : 'smtp' , syncRange : 'auto' , credentials : credentials , receiveConnInfo : imapConnInfo , sendConnInfo : smtpConnInfo , identities : [ { id : accountId + '/' + $a64 . encodeInt ( universe . config . nextIdentityNum ++ ) , name : userDetails . displayName , address : userDetails . emailAddress , replyTo : null , signature : null } , ] , tzOffset : tzOffset , } ; this . _loadAccount ( universe , accountDef , null , imapProtoConn , function ( account ) { callback ( null , account , null ) ; } ) ; }
Define an account now that we have verified the credentials are good and
 the server meets our minimal functionality standards.
Define an account now that we have verified the credentials are good and the server meets our minimal functionality standards .