fixing openBox method for node-0.4.0 (was broken when the argument "readOnly" was skipped by the user)

fork
Vytautas Jakutis 14 years ago committed by Brian White
parent 1e1031f06d
commit e739623172

@ -402,9 +402,14 @@ ImapConnection.prototype.openBox = function(name, readOnly, cb) {
throw new Error('Not connected or authenticated');
if (this._state.status === STATES.BOXSELECTED)
this._resetBox();
if (typeof readOnly !== 'boolean')
if (typeof cb === 'undefined') {
if(typeof readOnly === 'undefined') {
cb = function(){};
} else {
cb = readOnly;
}
readOnly = false;
cb = arguments[arguments.length-1];
}
this._state.status = STATES.BOXSELECTING;
this._state.box.name = name;

Loading…
Cancel
Save