From e4a4fed9214ae359a6055471b0d83d4c43211b6b Mon Sep 17 00:00:00 2001 From: mscdex Date: Thu, 11 Apr 2013 18:13:50 -0400 Subject: [PATCH] un-escape gmail labels --- lib/imap.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/imap.js b/lib/imap.js index 49b02ae..f019d14 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -30,6 +30,7 @@ var CRLF = '\r\n', RE_RES_NOOP = /^NOOP /i, RE_CMD_FETCH = /^(?:UID )?FETCH/i, RE_PARTID = /^(?:[\d]+[\.]{0,1})*[\d]+$/, + RE_ESCAPE = /\\\\/g, //RE_ISPARTIAL = /<(\d+)>$/, RE_DBLQ = /"/g, RE_CMD = /^([^ ]+)(?: |$)/, @@ -334,6 +335,12 @@ ImapConnection.prototype.connect = function(loginCb) { parsers.parseFetch(m.info, indata.literals, details); details.seqno = parseInt(m.num, 10); + if (typeof details['x-gm-labels'] !== undefined) { + var labels = details['x-gm-labels']; + for (var i=0, len=labels.length; i