Fix variable re-use

fork
Brian White 12 years ago
parent 3ce485ef2d
commit 847ac47757

@ -452,19 +452,20 @@ ImapConnection.prototype.connect = function(loginCb) {
self.debug&&self.debug('[parsing incoming] saw untagged ' + m[1]);
switch (m[1]) {
case 'OK':
var code = m[2];
if (state.status === STATES.NOAUTH) {
if (!state.isReady) {
state.isReady = true;
state.conn.emit('ready');
}
} else if (/^ALERT$/i.test(m[2]))
} else if (/^ALERT$/i.test(code))
self.emit('alert', m[3]);
else if (state.status === STATES.BOXSELECTING) {
if (m = /^UIDVALIDITY (\d+)/i.exec(m[2]))
if (m = /^UIDVALIDITY (\d+)/i.exec(code))
state.box.uidvalidity = m[1];
else if (m = /^UIDNEXT (\d+)/i.exec(m[2]))
else if (m = /^UIDNEXT (\d+)/i.exec(code))
state.box.uidnext = m[1];
else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(m[2])) {
else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(code)) {
var idx, permFlags, keywords;
state.box.permFlags = permFlags = m[1].split(' ');
if ((idx = state.box.permFlags.indexOf('\\*')) > -1) {

Loading…
Cancel
Save