/**
* Determine whether we're hiding deleted messages.
*
+ * @param string $mbox The current mailbox.
* @param boolean $force Force a redetermination of the return value
* (return value is normally cached after the first
* call).
*
* @return boolean True if deleted messages should be hidden.
*/
- static public function hideDeletedMsgs($force = false)
+ static public function hideDeletedMsgs($mbox, $force = false)
{
$delhide = &self::$_delhide;
$sortpref = self::getSort();
$delhide = ($GLOBALS['prefs']->getValue('delhide') &&
!$GLOBALS['prefs']->getValue('use_trash') &&
- ($GLOBALS['imp_search']->isSearchMbox() ||
+ ($GLOBALS['imp_search']->isSearchMbox($mbox) ||
($sortpref['by'] != Horde_Imap_Client::SORT_THREAD)));
}
}
$mbox = $GLOBALS['imp_mbox']['mailbox'];
}
- $prefmbox = $GLOBALS['imp_search']->isSearchMbox()
+ $prefmbox = $GLOBALS['imp_search']->isSearchMbox($mbox)
? $mbox
: self::folderPref($mbox, false);
$query = null;
if ($this->_searchmbox) {
- if (IMP::hideDeletedMsgs()) {
+ if (IMP::hideDeletedMsgs($this->_mailbox)) {
$query = new Horde_Imap_Client_Search_Query();
$query->flag('\\deleted', false);
}
$this->_sorted = $threadob->messageList((bool)$sortpref['dir']);
} else {
if (($_SESSION['imp']['protocol'] != 'pop') &&
- IMP::hideDeletedMsgs()) {
+ IMP::hideDeletedMsgs($this->_mailbox)) {
$query = new Horde_Imap_Client_Search_Query();
$query->flag('\\deleted', false);
}
$criteria = new Horde_Imap_Client_Search_Query();
- if (IMP::hideDeletedMsgs()) {
+ if (IMP::hideDeletedMsgs($this->_mailbox)) {
$criteria->flag('\\deleted', false);
} elseif ($count) {
try {
$GLOBALS['imp_mbox'] = IMP::getCurrentMailboxInfo();
// Initialize IMP_Search object.
-$GLOBALS['imp_search'] = (isset($_SESSION['imp']) && strpos($GLOBALS['imp_mbox']['mailbox'], IMP::SEARCH_MBOX) === 0)
+$GLOBALS['imp_search'] = (isset($_SESSION['imp']) && IMP_Search::isSearchMbox($GLOBALS['imp_mbox']['mailbox']))
? new IMP_Search(array('id' => $GLOBALS['imp_mbox']['mailbox']))
: new IMP_Search();
}
/* Is this a search mailbox? */
-$search_mbox = $imp_search->isSearchMbox();
+$search_mbox = $imp_search->isSearchMbox($imp_mbox['mailbox']);
$vfolder = $imp_search->isVFolder();
/* There is a chance that this page is loaded directly via message.php. If so,
case 'hide_deleted':
$prefs->setValue('delhide', !$prefs->getValue('delhide'));
- IMP::hideDeletedMsgs(true);
+ IMP::hideDeletedMsgs($imp_mbox['mailbox'], true);
break;
case 'expunge_mailbox':
$mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('preview' => $show_preview, 'headers' => $overview_headers, 'structure' => $prefs->getValue('atc_flag')));
/* Determine sorting preferences. */
-$sortpref = IMP::getSort();
+$sortpref = IMP::getSort($imp_mbox['mailbox']);
/* If search results are empty, return to the search page if this is
* not a virtual folder. */
exit;
}
if (($_SESSION['imp']['protocol'] != 'pop') &&
- !IMP::hideDeletedMsgs() &&
+ !IMP::hideDeletedMsgs($imp_mbox['mailbox']) &&
!$GLOBALS['prefs']->getValue('use_trash')) {
$imp_mailbox->setIndex(1, 'offset');
}
function _moveAfterAction()
{
return (($_SESSION['imp']['protocol'] != 'pop') &&
- !IMP::hideDeletedMsgs() &&
+ !IMP::hideDeletedMsgs($GLOBALS['imp_mbox']['mailbox']) &&
!$GLOBALS['prefs']->getValue('use_trash'));
}