From 7fd19309cc603053421c1c4a4e6607773b5b061d Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 11 Jun 2009 07:53:32 +0000 Subject: - speed up empty folder selection --- program/steps/mail/list.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'program/steps/mail/list.inc') 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); -- cgit v1.2.3