Fix so when moving to Trash we make sure the folder exists (#5192)

pull/5432/head
Aleksander Machniak 8 years ago
parent 2e1675bc4a
commit f92052fd73

@ -53,6 +53,7 @@ CHANGELOG Roundcube Webmail
- Fix error causing empty INBOX listing in Firefox when using an URL with user:password specified (#5400)
- Fix PHP warning when handling shared namespace with empty prefix (#5420)
- Fix so folders list is scrolled to the selected folder on page load (#5424)
- Fix so when moving to Trash we make sure the folder exists (#5192)
RELEASE 1.2.1
-------------

@ -2596,6 +2596,14 @@ class rcube_imap extends rcube_storage
// move messages
$moved = $this->conn->move($uids, $from_mbox, $to_mbox);
// when moving to Trash we make sure the folder exists
// as it's uncommon scenario we do this when MOVE fails, not before
if (!$moved && $to_trash && $this->get_response_code() == rcube_storage::TRYCREATE) {
if ($this->create_folder($to_mbox, true, 'trash')) {
$moved = $this->conn->move($uids, $from_mbox, $to_mbox);
}
}
if ($moved) {
$this->clear_messagecount($from_mbox);
$this->clear_messagecount($to_mbox);

Loading…
Cancel
Save