summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-30 17:08:30 +0000
committeralecpl <alec@alec.pl>2009-05-30 17:08:30 +0000
commit6138a55f805b17a375c52f1dbc6b13712200502e (patch)
treecce8080d341aabf2c17796664b17254104f7b8c7 /program/include/rcube_imap.php
parentdc2fc082d372cc58f6d660d89fa19788be0d4c34 (diff)
- fixed headers prefetching
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index c6ff12575..1e2ac0059 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -1156,7 +1156,7 @@ class rcube_imap
{
$struct = new rcube_message_part;
$struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
-
+
// multipart
if (is_array($part[0]))
{
@@ -1178,18 +1178,19 @@ class rcube_imap
// fetch message headers if message/rfc822 or named part (could contain Content-Location header)
if (strtolower($part[$i][0]) == 'message' ||
(in_array('name', (array)$part[$i][2]) && (empty($part[$i][3]) || $part[$i][3]=='NIL'))) {
- $part_headers[] = $struct->mime_id ? $struct->mime_id.'.'.$i+1 : $i+1;
+ $part_headers[] = $struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1;
}
-
+
// pre-fetch headers of all parts (in one command for better performance)
if ($part_headers)
$part_headers = iil_C_FetchMIMEHeaders($this->conn, $this->mailbox, $this->_msg_id, $part_headers);
$struct->parts = array();
for ($i=0, $count=0; $i<count($part); $i++)
- if (is_array($part[$i]) && count($part[$i]) > 3)
+ if (is_array($part[$i]) && count($part[$i]) > 3) {
$struct->parts[] = $this->_structure_part($part[$i], ++$count, $struct->mime_id,
- $part_headers[$struct->mime_id ? $struck->mime_id.'.'.$i+1 : $i+1]);
+ $part_headers[$struct->mime_id ? $struct->mime_id.'.'.($i+1) : $i+1]);
+ }
return $struct;
}