From 65c4c3195cfe3c91b1b32791097f5be324681920 Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 4 Nov 2010 14:03:26 +0000 Subject: - Add possibility to force mailbox selection. There're situations where we're invoking STATUS (for all messages count) and SELECT later for other operations. If we call SELECT first, the STATUS will be not needed. git-svn-id: https://svn.roundcube.net/trunk@4180 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/steps/mail/pagenav.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'roundcubemail/program/steps') diff --git a/roundcubemail/program/steps/mail/pagenav.inc b/roundcubemail/program/steps/mail/pagenav.inc index b62520fab..e295114e1 100644 --- a/roundcubemail/program/steps/mail/pagenav.inc +++ b/roundcubemail/program/steps/mail/pagenav.inc @@ -20,7 +20,13 @@ */ $uid = get_input_value('_uid', RCUBE_INPUT_GET); -$cnt = $IMAP->messagecount(NULL, 'ALL'); // Only messages, no threads here + +// Select mailbox first, for better performance +$mbox_name = $IMAP->get_mailbox_name(); +$IMAP->select_mailbox($mbox_name); + +// Get messages count (only messages, no threads here) +$cnt = $IMAP->messagecount(NULL, 'ALL'); if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC' && empty($_REQUEST['_search']) && !$CONFIG['skip_deleted'] && !$IMAP->threading -- cgit v1.2.3