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]); self.debug&&self.debug('[parsing incoming] saw untagged ' + m[1]);
switch (m[1]) { switch (m[1]) {
case 'OK': case 'OK':
var code = m[2];
if (state.status === STATES.NOAUTH) { if (state.status === STATES.NOAUTH) {
if (!state.isReady) { if (!state.isReady) {
state.isReady = true; state.isReady = true;
state.conn.emit('ready'); state.conn.emit('ready');
} }
} else if (/^ALERT$/i.test(m[2])) } else if (/^ALERT$/i.test(code))
self.emit('alert', m[3]); self.emit('alert', m[3]);
else if (state.status === STATES.BOXSELECTING) { 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]; 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]; state.box.uidnext = m[1];
else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(m[2])) { else if (m = /^PERMANENTFLAGS \((.*)\)/i.exec(code)) {
var idx, permFlags, keywords; var idx, permFlags, keywords;
state.box.permFlags = permFlags = m[1].split(' '); state.box.permFlags = permFlags = m[1].split(' ');
if ((idx = state.box.permFlags.indexOf('\\*')) > -1) { if ((idx = state.box.permFlags.indexOf('\\*')) > -1) {

Loading…
Cancel
Save