|
|
@ -2527,9 +2527,10 @@ class rcube_imap extends rcube_storage
|
|
|
|
NULL, array('SUBSCRIBED'));
|
|
|
|
NULL, array('SUBSCRIBED'));
|
|
|
|
|
|
|
|
|
|
|
|
// unsubscribe non-existent folders, remove from the list
|
|
|
|
// unsubscribe non-existent folders, remove from the list
|
|
|
|
if (is_array($a_folders) && $name == '*') {
|
|
|
|
// we can do this only when LIST response is available
|
|
|
|
|
|
|
|
if (is_array($a_folders) && $name == '*' && !empty($this->conn->data['LIST'])) {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
if (($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
&& in_array('\\NonExistent', $opts)
|
|
|
|
&& in_array('\\NonExistent', $opts)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
$this->conn->unsubscribe($folder);
|
|
|
|
$this->conn->unsubscribe($folder);
|
|
|
@ -2542,11 +2543,12 @@ class rcube_imap extends rcube_storage
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
$a_folders = $this->conn->listSubscribed($root, $name);
|
|
|
|
$a_folders = $this->conn->listSubscribed($root, $name);
|
|
|
|
|
|
|
|
|
|
|
|
// unsubscribe non-existent folders, remove from the list
|
|
|
|
// unsubscribe non-existent folders, remove them from the list,
|
|
|
|
if (is_array($a_folders) && $name == '*') {
|
|
|
|
// we can do this only when LIST response is available
|
|
|
|
|
|
|
|
if (is_array($a_folders) && $name == '*' && !empty($this->conn->data['LIST'])) {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
foreach ($a_folders as $idx => $folder) {
|
|
|
|
if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder])
|
|
|
|
if (!isset($this->conn->data['LIST'][$folder])
|
|
|
|
&& in_array('\\Noselect', $opts)
|
|
|
|
|| in_array('\\Noselect', $this->conn->data['LIST'][$folder])
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
// Some servers returns \Noselect for existing folders
|
|
|
|
// Some servers returns \Noselect for existing folders
|
|
|
|
if (!$this->folder_exists($folder)) {
|
|
|
|
if (!$this->folder_exists($folder)) {
|
|
|
|