Comparing version 0.8.1 to 0.8.2
@@ -906,4 +906,6 @@ var tls = require('tls'), | ||
var quotas = {}; | ||
for (var i = 0, len = quotalist.length; i < len; ++i) | ||
quotas[quotalist[i].root] = quotalist[i].resources; | ||
if (quotalist) { | ||
for (var i = 0, len = quotalist.length; i < len; ++i) | ||
quotas[quotalist[i].root] = quotalist[i].resources; | ||
} | ||
@@ -1014,4 +1016,4 @@ cb(err, quotas); | ||
}, | ||
fetch: function(seqnos, options, what, cb) { | ||
return self._fetch('', seqnos, options, what, cb); | ||
fetch: function(seqnos, options) { | ||
return self._fetch('', seqnos, options); | ||
}, | ||
@@ -1112,7 +1114,9 @@ search: function(options, cb) { | ||
this._createCurrentBox(); | ||
this._box.messages.new = info.num; | ||
if (this._box) | ||
this._box.messages.new = info.num; | ||
} else if (type === 'flags') { | ||
if (!this._box && RE_OPENBOX.test(this._curReq.type)) | ||
this._createCurrentBox(); | ||
this._box.flags = info.text; | ||
if (this._box) | ||
this._box.flags = info.text; | ||
} else if (type === 'bad' || type === 'no') { | ||
@@ -1129,14 +1133,18 @@ if (this.state === 'connected' && !this._curReq) { | ||
this._createCurrentBox(); | ||
var prev = this._box.messages.total, | ||
now = info.num; | ||
this._box.messages.total = now; | ||
if (now > prev && this.state === 'authenticated') { | ||
this._box.messages.new = now - prev; | ||
this.emit('mail', this._box.messages.total); | ||
if (this._box) { | ||
var prev = this._box.messages.total, | ||
now = info.num; | ||
this._box.messages.total = now; | ||
if (now > prev && this.state === 'authenticated') { | ||
this._box.messages.new = now - prev; | ||
this.emit('mail', this._box.messages.total); | ||
} | ||
} | ||
} else if (type === 'expunge') { | ||
if (this._box.messages.total > 0) | ||
--this._box.messages.total; | ||
if (!this._curReq) | ||
this.emit('expunge', info.num); | ||
if (this._box) { | ||
if (this._box.messages.total > 0) | ||
--this._box.messages.total; | ||
if (!this._curReq) | ||
this.emit('expunge', info.num); | ||
} | ||
} else if (type === 'ok') { | ||
@@ -1143,0 +1151,0 @@ if (this.state === 'connected' && !this._curReq) |
@@ -58,13 +58,10 @@ var EventEmitter = require('events').EventEmitter, | ||
if (/^v0\.8\./.test(process.version)) { | ||
var newStream = new ReadableStream(), | ||
wrapped = newStream.wrap(stream); | ||
// as of now, 07/02/2013, the readable-stream module is behind in updates | ||
// and has different behavior for the return value of wrap() compared to | ||
// node v0.10+, so we check for that here ... | ||
if (wrapped) | ||
stream = wrapped; | ||
else | ||
stream = newStream; | ||
} | ||
this._stream = stream; | ||
this._stream = (new ReadableStream()).wrap(stream); | ||
// since Readable.wrap() proxies events, we need to remove at least the | ||
// proxied 'error' event since this can cause problems and Parser doesn't | ||
// care about such events | ||
stream._events.error.pop(); | ||
} else | ||
this._stream = stream; | ||
}; | ||
@@ -71,0 +68,0 @@ |
{ "name": "imap", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -9,3 +9,3 @@ "description": "An IMAP module for node.js that makes communicating with IMAP servers easy", | ||
"iconv-lite": "0.2.11", | ||
"readable-stream": "1.0.2" | ||
"readable-stream": "1.0.15" | ||
}, | ||
@@ -12,0 +12,0 @@ "scripts": { |
769816
7566
+ Addedreadable-stream@1.0.15(transitive)
- Removedreadable-stream@1.0.2(transitive)
Updatedreadable-stream@1.0.15