summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-11 14:34:48 +0000
committeralecpl <alec@alec.pl>2009-07-11 14:34:48 +0000
commit40dfeaddf8ae05604f803b55f9f5c69c04a764a6 (patch)
tree4f287a9a22b39836e3aba33e94e8f0ae23a746bd /program/lib
parent34ebe0ba2c726bc679778dfb9faf92b30f303494 (diff)
- Performance improvements by use UID commands (#1485690)
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/imap.inc20
1 files changed, 6 insertions, 14 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index a8f858ea6..0ab2b7fc8 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -2190,14 +2190,14 @@ function iil_C_FetchMIMEHeaders(&$conn, $mailbox, $id, $parts) {
return $result;
}
-function iil_C_FetchPartHeader(&$conn, $mailbox, $id, $part) {
+function iil_C_FetchPartHeader(&$conn, $mailbox, $id, $is_uid=false, $part=NULL) {
$part = empty($part) ? 'HEADER' : $part.'.MIME';
- return iil_C_HandlePartBody($conn, $mailbox, $id, $part);
+ return iil_C_HandlePartBody($conn, $mailbox, $id, $is_uid, $part);
}
-function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $print=NULL, $file=NULL) {
+function iil_C_HandlePartBody(&$conn, $mailbox, $id, $is_uid=false, $part='', $encoding=NULL, $print=NULL, $file=NULL) {
$fp = $conn->fp;
$result = false;
@@ -2224,7 +2224,7 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $
// format request
$key = 'ftch0';
- $request = $key . " FETCH $id (BODY.PEEK[$part])";
+ $request = $key . ($is_uid ? ' UID' : '') . " FETCH $id (BODY.PEEK[$part])";
// send request
if (!iil_PutLine($fp, $request)) {
return false;
@@ -2346,14 +2346,6 @@ function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part='', $encoding=NULL, $
return false;
}
-function iil_C_FetchPartBody(&$conn, $mailbox, $id, $part, $file=NULL) {
- return iil_C_HandlePartBody($conn, $mailbox, $id, $part, NULL, NULL, $file);
-}
-
-function iil_C_PrintPartBody(&$conn, $mailbox, $id, $part) {
- iil_C_HandlePartBody($conn, $mailbox, $id, $part, NULL, true, NULL);
-}
-
function iil_C_CreateFolder(&$conn, $folder) {
$fp = $conn->fp;
if (iil_PutLine($fp, 'c CREATE "' . iil_Escape($folder) . '"')) {
@@ -2477,14 +2469,14 @@ function iil_C_AppendFromFile(&$conn, $folder, $path) {
return false;
}
-function iil_C_FetchStructureString(&$conn, $folder, $id) {
+function iil_C_FetchStructureString(&$conn, $folder, $id, $is_uid=false) {
$fp = $conn->fp;
$result = false;
if (iil_C_Select($conn, $folder)) {
$key = 'F1247';
- if (iil_PutLine($fp, "$key FETCH $id (BODYSTRUCTURE)")) {
+ if (iil_PutLine($fp, $key . ($is_uid ? ' UID' : '') ." FETCH $id (BODYSTRUCTURE)")) {
do {
$line = iil_ReadLine($fp, 5000);
$line = iil_MultLine($fp, $line);