more unsolicited response checks

fork
mscdex 12 years ago
parent 3d7b5e4cc8
commit 685a682572

@ -309,9 +309,9 @@ ImapConnection.prototype.connect = function(loginCb) {
} }
if (indata.line[0] === '*') { // Untagged server response if (indata.line[0] === '*') { // Untagged server response
var isUnsolicited = var isUnsolicited = (requests[0] && requests[0].cmd === 'NOOP')
(requests[0] && requests[0].cmd === 'NOOP') || (state.isIdle && state.ext.idle.state !== IDLE_NONE)
|| (state.isIdle && state.ext.idle.state !== IDLE_NONE); || !requests.length;
if (m = XRegExp.exec(indata.line, REX_UNRESPNUM)) { if (m = XRegExp.exec(indata.line, REX_UNRESPNUM)) {
// m.type = response type (numeric-based) // m.type = response type (numeric-based)
m.type = m.type.toUpperCase(); m.type = m.type.toUpperCase();
@ -321,8 +321,13 @@ ImapConnection.prototype.connect = function(loginCb) {
// m.info = message details // m.info = message details
var data, parsed, headers, f, lenf, body, lenb, msg, bodies, var data, parsed, headers, f, lenf, body, lenb, msg, bodies,
details, val; details, val;
isUnsolicited = isUnsolicited
|| (requests[0] && requests[0].cmd !== 'FETCH');
if (!isUnsolicited) if (!isUnsolicited)
bodies = parsers.parseFetchBodies(m.info, indata.literals); bodies = parsers.parseFetchBodies(m.info, indata.literals);
details = new ImapMessage(); details = new ImapMessage();
parsers.parseFetch(m.info, indata.literals, details); parsers.parseFetch(m.info, indata.literals, details);
details.seqno = parseInt(m.num, 10); details.seqno = parseInt(m.num, 10);

Loading…
Cancel
Save