apps/email/js/ext/mailapi/composite/configurator.js
/**
 * Composite account type to expose account piece types with individual
 * implementations (ex: imap, smtp) together as a single account.  This is
 * intended to be a very thin layer that shields consuming code from the
 * fact that IMAP and SMTP are not actually bundled tightly together.
 */
Composite account type to expose account piece types with individual
implementations (ex: imap, smtp) together as a single account.  This is
intended to be a very thin layer that shields consuming code from the
fact that IMAP and SMTP are not actually bundled tightly together.
Composite account type to expose account piece types with individual implementations ( ex : imap smtp ) together as a single account . This is intended to be a very thin layer that shields consuming code from the fact that IMAP and SMTP are not actually bundled tightly together .
function CompositeAccount(universe, accountDef, folderInfo, dbConn,
                          receiveProtoConn,
                          _LOG) {
  this.universe = universe;
  this.id = accountDef.id;
  this.accountDef = accountDef;
  this._enabled = true;
  this.problems = [];
  this._LOG = _LOG;
  this.identities = accountDef.identities;
  if (!PIECE_ACCOUNT_TYPE_TO_CLASS.hasOwnProperty(accountDef.receiveType)) {
    this._LOG.badAccountType(accountDef.receiveType);
  }
  if (!PIECE_ACCOUNT_TYPE_TO_CLASS.hasOwnProperty(accountDef.sendType)) {
    this._LOG.badAccountType(accountDef.sendType);
  }
  this._receivePiece =
    new PIECE_ACCOUNT_TYPE_TO_CLASS[accountDef.receiveType](
      universe, this,
      accountDef.id, accountDef.credentials, accountDef.receiveConnInfo,
      folderInfo, dbConn, this._LOG, receiveProtoConn);
  this._sendPiece =
    new PIECE_ACCOUNT_TYPE_TO_CLASS[accountDef.sendType](
      universe, this,
      accountDef.id, accountDef.credentials,
      accountDef.sendConnInfo, dbConn, this._LOG);
  this.folders = this._receivePiece.folders;
  this.meta = this._receivePiece.meta;
  this.mutations = this._receivePiece.mutations;
  this.tzOffset = accountDef.tzOffset;
}
function CompositeAccount ( universe , accountDef , folderInfo , dbConn , receiveProtoConn , _LOG ) { this . universe = universe ; this . id = accountDef . id ; this . accountDef = accountDef ; this . _enabled = true ; this . problems = [ ] ; this . _LOG = _LOG ; this . identities = accountDef . identities ; if ( ! PIECE_ACCOUNT_TYPE_TO_CLASS . hasOwnProperty ( accountDef . receiveType ) ) { this . _LOG . badAccountType ( accountDef . receiveType ) ; } if ( ! PIECE_ACCOUNT_TYPE_TO_CLASS . hasOwnProperty ( accountDef . sendType ) ) { this . _LOG . badAccountType ( accountDef . sendType ) ; } this . _receivePiece = new PIECE_ACCOUNT_TYPE_TO_CLASS [ accountDef . receiveType ] ( universe , this , accountDef . id , accountDef . credentials , accountDef . receiveConnInfo , folderInfo , dbConn , this . _LOG , receiveProtoConn ) ; this . _sendPiece = new PIECE_ACCOUNT_TYPE_TO_CLASS [ accountDef . sendType ] ( universe , this , accountDef . id , accountDef . credentials , accountDef . sendConnInfo , dbConn , this . _LOG ) ; this . folders = this . _receivePiece . folders ; this . meta = this . _receivePiece . meta ; this . mutations = this . _receivePiece . mutations ; this . tzOffset = accountDef . tzOffset ; }
Composite account type to expose account piece types with individual
 implementations (ex: imap, smtp) together as a single account.
Composite account type to expose account piece types with individual implementations ( ex : imap smtp ) together as a single account .
// Currently we don't persist the disabled state of an account because it's // easier for the UI to be edge-triggered right now and ensure that the // triggering occurs once each session. // XXX for now we are stealing the universe's logger // expose public lists that are always manipulated in place.