Connection: default to lowercased version of original attribute name if no mapping exists

fork
mscdex 11 years ago
parent 671c5b3e0d
commit 41554f5188

@ -20,12 +20,7 @@ var MAX_INT = 9007199254740992,
'RFC822.SIZE': 'size',
'BODY': 'struct',
'BODYSTRUCTURE': 'struct',
'UID': 'uid',
'INTERNALDATE': 'date',
'FLAGS': 'flags',
'X-GM-THRID': 'x-gm-thrid',
'X-GM-MSGID': 'x-gm-msgid',
'X-GM-LABELS': 'x-gm-labels'
'INTERNALDATE': 'date'
},
CRLF = '\r\n',
RE_CMD = /^([^ ]+)(?: |$)/,
@ -1217,7 +1212,7 @@ Connection.prototype._resUntagged = function(info) {
var msg = this._curReq.fetchCache[info.num],
keys = Object.keys(info.text),
keyslen = keys.length,
toget, msgEmitter, j;
toget, msgEmitter, j, key;
if (msg === undefined) {
// simple case -- no bodies were streamed
@ -1257,7 +1252,10 @@ Connection.prototype._resUntagged = function(info) {
for (var k = 0, lenk = labels.length; k < lenk; ++k)
labels[k] = (''+labels[k]).replace(RE_ESCAPE, '\\');
}
attrs[FETCH_ATTR_MAP[toget[i]]] = info.text[keys[j]];
key = FETCH_ATTR_MAP[toget[i]];
if (!key)
key = toget[i].toLowerCase();
attrs[key] = info.text[keys[j]];
}
toget.splice(i, 1);
break;

Loading…
Cancel
Save