|
|
|
@ -14,7 +14,7 @@ var CH_LF = 10,
|
|
|
|
|
RE_SEQNO = /^\* (\d+)/,
|
|
|
|
|
RE_LISTCONTENT = /^\((.*)\)$/,
|
|
|
|
|
RE_LITERAL = /\{(\d+)\}$/,
|
|
|
|
|
RE_UNTAGGED = /^\* (?:(OK|NO|BAD|BYE|FLAGS|LIST|LSUB|SEARCH|STATUS|CAPABILITY|NAMESPACE|PREAUTH|SORT|THREAD|ESEARCH|QUOTA|QUOTAROOT)|(\d+) (EXPUNGE|FETCH|RECENT|EXISTS))(?: (?:\[([^\]]+)\] )?(.+))?$/i,
|
|
|
|
|
RE_UNTAGGED = /^\* (?:(OK|NO|BAD|BYE|FLAGS|ID|LIST|LSUB|SEARCH|STATUS|CAPABILITY|NAMESPACE|PREAUTH|SORT|THREAD|ESEARCH|QUOTA|QUOTAROOT)|(\d+) (EXPUNGE|FETCH|RECENT|EXISTS))(?: (?:\[([^\]]+)\] )?(.+))?$/i,
|
|
|
|
|
RE_TAGGED = /^A(\d+) (OK|NO|BAD) (?:\[([^\]]+)\] )?(.+)$/i,
|
|
|
|
|
RE_CONTINUE = /^\+(?: (?:\[([^\]]+)\] )?(.+))?$/i,
|
|
|
|
|
RE_CRLF = /\r\n/g,
|
|
|
|
@ -249,6 +249,8 @@ Parser.prototype._resUntagged = function() {
|
|
|
|
|
val = [];
|
|
|
|
|
} else if (type === 'list' || type === 'lsub')
|
|
|
|
|
val = parseBoxList(m[5], this._literals);
|
|
|
|
|
else if (type === 'id')
|
|
|
|
|
val = parseId(m[5], this._literals);
|
|
|
|
|
else if (type === 'status')
|
|
|
|
|
val = parseStatus(m[5], this._literals);
|
|
|
|
|
else if (type === 'fetch')
|
|
|
|
@ -329,6 +331,17 @@ function parseESearch(text, literals) {
|
|
|
|
|
return attrs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseId(text, literals) {
|
|
|
|
|
var r = parseExpr(text, literals),
|
|
|
|
|
id = {};
|
|
|
|
|
|
|
|
|
|
for (var i = 0, len = r[0].length; i < len; i += 2) {
|
|
|
|
|
id[r[0][i].toLowerCase()] = r[0][i + 1]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseQuota(text, literals) {
|
|
|
|
|
var r = parseExpr(text, literals),
|
|
|
|
|
resources = {};
|
|
|
|
|