diff options
author | thomascube <thomas@roundcube.net> | 2010-03-02 21:27:53 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2010-03-02 21:27:53 +0000 |
commit | 7c9d922b96f9a88b350d6e07f5bde84ccc40f9b0 (patch) | |
tree | 52c1887baa334a3d6eeed51a379a2abaa6a77834 /program/lib/imap.inc | |
parent | ffaea6f6ded918d8d12d858ede0cda8ef5655aa4 (diff) |
New recent check based on UIDs
Diffstat (limited to 'program/lib/imap.inc')
-rw-r--r-- | program/lib/imap.inc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc index ed30937fa..9a5a67bef 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -915,7 +915,7 @@ function iil_C_Sort(&$conn, $mailbox, $field, $add='', $is_uid=FALSE, return preg_split('/\s+/', $data, -1, PREG_SPLIT_NO_EMPTY); } -function iil_C_FetchHeaderIndex(&$conn, $mailbox, $message_set, $index_field='', $skip_deleted=true) { +function iil_C_FetchHeaderIndex(&$conn, $mailbox, $message_set, $index_field='', $skip_deleted=true, $uidfetch=false) { list($from_idx, $to_idx) = explode(':', $message_set); if (empty($message_set) || @@ -949,21 +949,22 @@ function iil_C_FetchHeaderIndex(&$conn, $mailbox, $message_set, $index_field='', // build FETCH command string $key = 'fhi0'; + $cmd = $uidfetch ? 'UID FETCH' : 'FETCH'; $deleted = $skip_deleted ? ' FLAGS' : ''; if ($mode == 1 && $index_field == 'DATE') - $request = " FETCH $message_set (INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE)]$deleted)"; + $request = " $cmd $message_set (INTERNALDATE BODY.PEEK[HEADER.FIELDS (DATE)]$deleted)"; else if ($mode == 1) - $request = " FETCH $message_set (BODY.PEEK[HEADER.FIELDS ($index_field)]$deleted)"; + $request = " $cmd $message_set (BODY.PEEK[HEADER.FIELDS ($index_field)]$deleted)"; else if ($mode == 2) { if ($index_field == 'SIZE') - $request = " FETCH $message_set (RFC822.SIZE$deleted)"; + $request = " $cmd $message_set (RFC822.SIZE$deleted)"; else - $request = " FETCH $message_set ($index_field$deleted)"; + $request = " $cmd $message_set ($index_field$deleted)"; } else if ($mode == 3) - $request = " FETCH $message_set (FLAGS)"; + $request = " $cmd $message_set (FLAGS)"; else // 4 - $request = " FETCH $message_set (INTERNALDATE$deleted)"; + $request = " $cmd $message_set (INTERNALDATE$deleted)"; $request = $key . $request; |