Merge pull request #343 from wavify/fix-nomodseq

Fix an issue with mailboxes that don't support modseq (NOMODSEQ)
fork
Brian White 10 years ago
commit bb79cc784f

@ -593,7 +593,7 @@ Connection.prototype._store = function(which, uids, cfg, cb) {
uids = uids.join(',');
var modifiers = '';
if (cfg.modseq !== undefined)
if (cfg.modseq !== undefined && !this._box.nomodseq)
modifiers += 'UNCHANGEDSINCE ' + cfg.modseq + ' ';
this._enqueue(which + 'STORE ' + uids + ' '
@ -742,7 +742,7 @@ Connection.prototype._fetch = function(which, uids, options) {
fetching.push('X-GM-MSGID');
fetching.push('X-GM-LABELS');
}
if (this.serverSupports('CONDSTORE'))
if (this.serverSupports('CONDSTORE') && !this._box.nomodseq)
fetching.push('MODSEQ');
fetching.push('UID');
@ -779,7 +779,8 @@ Connection.prototype._fetch = function(which, uids, options) {
modstr = ' (';
for (i = 0, len = modkeys.length, key; i < len; ++i) {
key = modkeys[i].toUpperCase();
if (key === 'CHANGEDSINCE' && this.serverSupports('CONDSTORE'))
if (key === 'CHANGEDSINCE' && this.serverSupports('CONDSTORE')
&& !this._box.nomodseq)
modstr += key + ' ' + modifiers[modkeys[i]] + ' ';
}
if (modstr.length > 2) {
@ -1260,6 +1261,8 @@ Connection.prototype._resUntagged = function(info) {
permFlags.splice(permFlags.indexOf(keywords[i]), 1);
} else if (key === 'UIDNOTSTICKY')
this._box.persistentUIDs = false;
else if (key === 'NOMODSEQ')
this._box.nomodseq = true;
} else if (typeof info.textCode === 'string'
&& info.textCode.toUpperCase() === 'UIDVALIDITY')
this.emit('uidvalidity', info.text);
@ -1477,6 +1480,7 @@ Connection.prototype._createCurrentBox = function() {
keywords: [],
newKeywords: false,
persistentUIDs: true,
nomodseq: false,
messages: {
total: 0,
new: 0

Loading…
Cancel
Save