From 30b30226e6569f13e444cdcb513cd2bfc24318d7 Mon Sep 17 00:00:00 2001 From: alecpl 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. --- program/steps/mail/pagenav.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'program/steps') diff --git a/program/steps/mail/pagenav.inc b/program/steps/mail/pagenav.inc index b62520fab..e295114e1 100644 --- a/program/steps/mail/pagenav.inc +++ b/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