Skip to content

Commit

Permalink
Fix so when moving to Trash we make sure the folder exists (#5192)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Sep 5, 2016
1 parent b64e22e commit d6f87f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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
-------------
Expand Down
8 changes: 8 additions & 0 deletions program/lib/Roundcube/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,14 @@ public function move_message($uids, $to_mbox, $from_mbox='')
// 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);
Expand Down

0 comments on commit d6f87f8

Please sign in to comment.