From b117766691308e9e303c86aef69b922eac54b885 Mon Sep 17 00:00:00 2001 From: destel Date: Wed, 13 Apr 2016 17:44:09 +0300 Subject: [PATCH] made all fields except the UID optional when fetching --- lib/Connection.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Connection.js b/lib/Connection.js index 0dff66c7b..d27d94f25 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -831,17 +831,23 @@ Connection.prototype._fetch = function(which, uids, options) { fetching = [], i, len, key; - if (this.serverSupports('X-GM-EXT-1')) { + if (this.serverSupports('X-GM-EXT-1') && options.gmail !== false) { fetching.push('X-GM-THRID'); fetching.push('X-GM-MSGID'); fetching.push('X-GM-LABELS'); } - if (this.serverSupports('CONDSTORE') && !this._box.nomodseq) + if (this.serverSupports('CONDSTORE') && !this._box.nomodseq && options.modseq !== false) fetching.push('MODSEQ'); fetching.push('UID'); - fetching.push('FLAGS'); - fetching.push('INTERNALDATE'); + + if (options.flags !== false) { + fetching.push('FLAGS'); + } + + if (options.date !== false) { + fetching.push('INTERNALDATE'); + } var modifiers;