Fix unexpected error message when mail refresh involves folder auto-unsubscribe (#6923)

pull/7179/head
Aleksander Machniak 4 years ago
parent 470e91e615
commit 9311c49cf4

@ -14,6 +14,7 @@ CHANGELOG Roundcube Webmail
- Fix so messages in threads with no root aren't displayed separately (#4999)
- Fix regression where "Open in new window" action didn't work (#7155)
- Fix PHP Warning: array_filter() expects parameter 1 to be array, null given in subscriptions_option plugin (#7165)
- Fix unexpected error message when mail refresh involves folder auto-unsubscribe (#6923)
RELEASE 1.4.2
-------------

@ -2946,6 +2946,9 @@ class rcube_imap extends rcube_storage
// Add/Remove folders according to some configuration options
$this->list_folders_filter($result, $root . $name, ($list_extended ? 'ext-' : '') . 'subscribed');
// Save the last command state, so we can ignore errors on any following UNSEBSCRIBE calls
$state = $this->save_conn_state();
if ($list_extended) {
// unsubscribe non-existent folders, remove from the list
if ($name == '*' && !empty($this->conn->data['LIST'])) {
@ -2977,6 +2980,8 @@ class rcube_imap extends rcube_storage
}
}
$this->restore_conn_state($state);
return $result;
}
@ -4573,6 +4578,31 @@ class rcube_imap extends rcube_storage
return $date->format('d-M-Y H:i:s O');
}
/**
* Remember state of the IMAP connection (last IMAP command).
* Use e.g. if you want to execute more commands and ignore results of these.
*
* @return array Connection state
*/
protected function save_conn_state()
{
return array(
$this->conn->error,
$this->conn->errornum,
$this->conn->resultcode,
);
}
/**
* Restore saved connection state.
*
* @param array $state Connection result
*/
protected function restore_conn_state($state)
{
list($this->conn->error, $this->conn->errornum, $this->conn->resultcode) = $state;
}
/**
* This is our own debug handler for the IMAP connection
*/

Loading…
Cancel
Save