Don't change internal state when opening a box until the command is actually sent

fork
Brian White 12 years ago
parent 639701125b
commit 6554c74e61

@ -657,7 +657,7 @@ ImapConnection.prototype.openBox = function(name, readOnly, cb) {
cb = readOnly;
readOnly = false;
}
this._state.status = STATES.BOXSELECTING;
this._state.box.name = name;
this._send((readOnly ? 'EXAMINE' : 'SELECT') + ' "' + utils.escape(name)
@ -1294,6 +1294,10 @@ ImapConnection.prototype._send = function(cmdstr, cb, bypass) {
this._state.conn.cleartext.write(cmd);
this._state.conn.cleartext.write(CRLF);
this.debug&&this.debug('\n==> ' + prefix + cmd + '\n');
if (this._state.requests[0]
&& (this._state.requests[0].cmd === 'EXAMINE'
|| this._state.requests[0].cmd === 'SELECT'))
this._state.status = STATES.BOXSELECTING;
}
};

Loading…
Cancel
Save