Skip to content

Commit

Permalink
lib-storage: Fixed mailbox_delete_empty() error message when mails exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Jul 1, 2016
1 parent 4f6d918 commit 804d4d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib-storage/index/index-storage.c
Expand Up @@ -718,7 +718,13 @@ int index_storage_mailbox_delete_pre(struct mailbox *box)
if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0)
return -1;
mailbox_get_open_status(box, STATUS_MESSAGES, &status);
if (status.messages != 0) {
if (status.messages == 0)
;
else if (box->deleting_must_be_empty) {
mail_storage_set_error(box->storage, MAIL_ERROR_EXISTS,
"Mailbox isn't empty");
return -1;
} else {
mail_storage_set_error(box->storage, MAIL_ERROR_EXISTS,
"New mails were added to mailbox during deletion");
return -1;
Expand Down

0 comments on commit 804d4d3

Please sign in to comment.