Skip to content

Commit

Permalink
Fix exists check for container mailboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jun 9, 2014
1 parent 79b9d8f commit 47ea175
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions imp/lib/Mailbox/SessionCache.php
Expand Up @@ -306,11 +306,13 @@ public function exists($mbox)
}

try {
$exists = (bool)$mbox->imp_imap->listMailboxes(
$mbox_list = $mbox->imp_imap->listMailboxes(
$mbox->imap_mbox_ob,
null,
array('flat' => true)
array('attributes' => true)
);
$exists = (isset($mbox_list[strval($mbox)]) &&
!in_array('\\noselect', $mbox_list[strval($mbox)]['attributes']));
} catch (IMP_Imap_Exception $e) {
$exists = false;
}
Expand Down

0 comments on commit 47ea175

Please sign in to comment.