diff options
author | alecpl <alec@alec.pl> | 2010-03-18 13:02:18 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-03-18 13:02:18 +0000 |
commit | 15e00bdf5002844841cc76e4d699157a475b0211 (patch) | |
tree | 5684369ebbeffd2070b26e274b96103ad6baf04b /program/lib | |
parent | 1845fb6318dd082bf29813833c2f6cb3f1794421 (diff) |
- Improved performance of folders operations (#1486525) + code cleanups
Diffstat (limited to 'program/lib')
-rw-r--r-- | program/lib/imap.inc | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc index 48363bec9..d77a226d8 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -1748,9 +1748,6 @@ function iil_C_GetHierarchyDelimiter(&$conn) { } function iil_C_ListMailboxes(&$conn, $ref, $mailbox) { - global $IGNORE_FOLDERS; - - $ignore = $IGNORE_FOLDERS[strtolower($conn->host)]; $fp = $conn->fp; @@ -1779,12 +1776,7 @@ function iil_C_ListMailboxes(&$conn, $ref, $mailbox) { // split one line $a = iil_ExplodeQuotedString(' ', $line); // last string is folder name - $folder = preg_replace(array('/^"/', '/"$/'), '', iil_UnEscape($a[count($a)-1])); - - if (empty($ignore) || (!empty($ignore) - && !preg_match('/'.preg_quote(ignore, '/').'/i', $folder))) { - $folders[$i] = $folder; - } + $folders[$i] = preg_replace(array('/^"/', '/"$/'), '', iil_UnEscape($a[count($a)-1])); // second from last is delimiter $delim = trim($a[count($a)-2], '"'); @@ -1812,9 +1804,6 @@ function iil_C_ListMailboxes(&$conn, $ref, $mailbox) { } function iil_C_ListSubscribed(&$conn, $ref, $mailbox) { - global $IGNORE_FOLDERS; - - $ignore = $IGNORE_FOLDERS[strtolower($conn->host)]; $fp = $conn->fp; if (empty($mailbox)) { @@ -1846,9 +1835,9 @@ function iil_C_ListSubscribed(&$conn, $ref, $mailbox) { $a = iil_ExplodeQuotedString(' ', $line); // last string is folder name $folder = preg_replace(array('/^"/', '/"$/'), '', iil_UnEscape($a[count($a)-1])); - - if ((!in_array($folder, $folders)) && (empty($ignore) - || (!empty($ignore) && !preg_match('/'.preg_quote(ignore, '/').'/i', $folder)))) { + + // @TODO: do we need this check??? + if (!in_array($folder, $folders)) { $folders[$i] = $folder; } |