summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-06-11 07:53:32 +0000
committeralecpl <alec@alec.pl>2009-06-11 07:53:32 +0000
commit7fd19309cc603053421c1c4a4e6607773b5b061d (patch)
tree7819f58cad5b3e040ea7aebd3228fd012a9eacca
parent5ab694d71c28cdaa311e0535fbef2aa9e8752012 (diff)
- speed up empty folder selection
-rw-r--r--program/steps/mail/list.inc5
1 files changed, 2 insertions, 3 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index d32e93996..8ba0dd017 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -57,11 +57,10 @@ if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL')
// fetch message headers
-if ($IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
+if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
$a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);
-$count = $IMAP->messagecount($mbox_name);
-$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh']));
+$unseen = $count ? $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])) : 0;
// update message count display
$pages = ceil($count/$IMAP->page_size);