summaryrefslogtreecommitdiff
path: root/program/steps/mail/list.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-06-04 07:18:26 +0000
committeralecpl <alec@alec.pl>2010-06-04 07:18:26 +0000
commit2144f9c43237056da7cb2a3224719faa118d1795 (patch)
tree1c42c77551ec7ed1335ee6f3b50bc5d939312a95 /program/steps/mail/list.inc
parentf22b5439f2e783f47f61042bebb6cc53672568fd (diff)
- Skip UNSEEN counting when list is empty
Diffstat (limited to 'program/steps/mail/list.inc')
-rw-r--r--program/steps/mail/list.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index 85e71a1f7..cf3855169 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -70,8 +70,13 @@ if ($count = $IMAP->messagecount($mbox_name, $IMAP->threading ? 'THREADS' : 'ALL
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']]))
$_SESSION['search'][$_REQUEST['_search']] = $IMAP->get_search_set();
+// empty result? we'll skip UNSEEN counting in rcmail_send_unread_count()
+if (empty($search_request) && empty($a_headers)) {
+ $unseen = 0;
+}
+
// update mailboxlist
-rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']));
+rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']), $unseen);
// update message count display
$pages = ceil($count/$IMAP->page_size);