From 0b380017fc0aea3ad779560f88b64ab7e5bc4745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Sat, 2 Jul 2011 05:37:27 +0800 Subject: [PATCH] Allow ALL in search queries --- README.md | 1 + imap.js | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 0cf4134..80bcd36 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,7 @@ ImapConnection Functions * **search**(Array, Function) - _(void)_ - Searches the currently open mailbox for messages using specific criterion. The Function parameter is the callback with two parameters: the error (null if none) and an Array containing the message IDs matching the search criterion. The Array parameter is a list of Arrays containing the criterion (and any required arguments) to be used. Prefix the criteria name with an "!" to negate. For example, to search for unread messages since April 20, 2010 you could use: [ 'UNSEEN', ['SINCE', 'April 20, 2010'] ]. To search for messages that are EITHER unread OR are dated April 20, 2010 or later, you could use: [ ['OR', 'UNSEEN', ['SINCE', 'April 20, 2010'] ] ]. * The following message flags are valid criterion and do not require values: + * 'ALL' - All messages. * 'ANSWERED' - Messages with the Answered flag set. * 'DELETED' - Messages with the Deleted flag set. * 'DRAFT' - Messages with the Draft flag set. diff --git a/imap.js b/imap.js index 0c27928..2957d6f 100644 --- a/imap.js +++ b/imap.js @@ -950,6 +950,7 @@ function buildSearchQuery(options, isOrChild) { criteria = criteria.substr(1); } switch(criteria) { + case 'ALL': case 'ANSWERED': case 'DELETED': case 'DRAFT':