Skip to content

Commit

Permalink
More thorough nonimap filter selection
Browse files Browse the repository at this point in the history
Children might be unviewable, so need to do a recursive search for at
least one visible nonimap child
  • Loading branch information
slusarz committed Jul 1, 2014
1 parent 057ccdc commit e8002ba
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions imp/lib/Ftree/IteratorFilter/Nonimap.php
Expand Up @@ -28,8 +28,25 @@ public function accept()
{
$curr = $this->current();

return (!$curr->nonimap ||
(($curr->remote || $curr->namespace) && $curr->children));
if (!$curr->nonimap) {
return true;
}

if (($curr->remote || $curr->namespace) && $curr->children) {
$iterator = new IMP_Ftree_IteratorFilter(
new IMP_Ftree_Iterator($curr)
);
$iterator->add(array(
$iterator::CONTAINERS,
$iterator::NONIMAP
));

foreach ($iterator as $val) {
return true;
}
}

return false;
}

}

0 comments on commit e8002ba

Please sign in to comment.