- 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.
| | |
| | | |
| | | |
| | | /** |
| | | * Forces selection of a mailbox |
| | | * |
| | | * @param string $mailbox Mailbox/Folder name |
| | | * @access public |
| | | */ |
| | | function select_mailbox($mailbox) |
| | | { |
| | | $mailbox = $this->mod_mailbox($mailbox); |
| | | |
| | | $selected = $this->conn->select($mailbox); |
| | | |
| | | if ($selected && $this->mailbox != $mailbox) { |
| | | // clear messagecount cache for this mailbox |
| | | $this->_clear_messagecount($mailbox); |
| | | $this->mailbox = $mailbox; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Set internal list page |
| | | * |
| | | * @param number $page Page number to list |
| | |
| | | */ |
| | | |
| | | $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 |