flags are case-insensitive

fork
mscdex 12 years ago
parent 0a8a4d5294
commit d22fe39448

@ -587,7 +587,7 @@ ImapConnection.prototype.connect = function(loginCb) {
for (i=0,len=keywords.length; i<len; ++i)
permFlags.splice(permFlags.indexOf(keywords[i]), 1);
state.box.permFlags = permFlags.map(function(f) {
return f.substr(1);
return f.substr(1).toLowerCase();
});
}
} else if (state.status === STATES.BOXSELECTED) {
@ -1465,7 +1465,7 @@ ImapConnection.prototype._store = function(which, uids, flags, isAdding, cb) {
if (!isKeywords) {
if (flags[i][0] === '\\')
flags[i] = flags[i].substr(1);
if (this._state.box.permFlags.indexOf(flags[i]) === -1
if (this._state.box.permFlags.indexOf(flags[i].toLowerCase()) === -1
|| flags[i] === '*')
throw new Error('The flag "' + flags[i]
+ '" is not allowed by the server for this mailbox');

Loading…
Cancel
Save