Skip to content

Commit

Permalink
Fix toggling hide deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Dec 22, 2014
1 parent bf88324 commit 179540b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 0 additions & 4 deletions imp/lib/Ajax/Application/Handler/Common.php
Expand Up @@ -104,10 +104,6 @@ public function viewPort()
try {
$vp = $this->_base->viewPortData($changed);
$result = true;

if (isset($vp_vars->delhide)) {
$vp->metadata_reset = 1;
}
} catch (Exception $e) {
$vp = new IMP_Ajax_Application_Viewport_Error($this->_base->indices->mailbox);
}
Expand Down
9 changes: 4 additions & 5 deletions imp/lib/Ajax/Application/ListMessages.php
Expand Up @@ -163,11 +163,10 @@ public function listMessages($args)
}

/* Mail-specific viewport information. */
if (($args['initial'] ||
$args['delhide'] ||
!is_null($args['sortby'])) &&
$mbox->hideDeletedMsgs(true)) {
$result->setMetadata('delhide', 1);
if ($args['initial'] ||
(isset($args['delhide']) && !is_null($args['delhide'])) ||
!is_null($args['sortby'])) {
$result->setMetadata('delhide', $mbox->hideDeletedMsgs(true));
}
if ($args['initial'] ||
!is_null($args['sortby']) ||
Expand Down
8 changes: 7 additions & 1 deletion imp/lib/Mailbox.php
Expand Up @@ -1472,6 +1472,8 @@ static public function prefTo($mbox)
*/
protected function _getCacheID($date = false)
{
global $prefs;

$date = $date
? 'D' . date('z')
: '';
Expand All @@ -1481,7 +1483,11 @@ protected function _getCacheID($date = false)
}

$sortpref = $this->getSort(true);
$addl = array($sortpref->sortby, $sortpref->sortdir);
$addl = array(
$sortpref->sortby,
$sortpref->sortdir,
intval($prefs->getValue('delhide'))
);
if ($date) {
$addl[] = $date;
}
Expand Down

0 comments on commit 179540b

Please sign in to comment.