Voicemail API: fix handling of full mailbox

Changes to an error code in svn r115582 was
the accidental cause of message deletion on
a full (by maxmsg) Old mailbox folder.

This restores the original handling marking
the message to be left in the Inbox.

ASTERISK-24942 #close
Review: https://reviewboard.asterisk.org/r/4595/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Scott Griepentrog
2015-04-07 19:34:35 +00:00
parent dc63b9fcbc
commit 3ade8a146a

View File

@@ -8802,7 +8802,7 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
} else if ((!strcasecmp(vms->curbox, "INBOX") || !strcasecmp(vms->curbox, "Urgent")) && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !vms->deleted[x]) {
/* Move to old folder before deleting */
res = save_to_folder(vmu, vms, x, 1, NULL, 0);
if (res == ERROR_LOCK_PATH) {
if (res) {
/* If save failed do not delete the message */
ast_log(AST_LOG_WARNING, "Save failed. Not moving message: %s.\n", res == ERROR_LOCK_PATH ? "unable to lock path" : "destination folder full");
vms->deleted[x] = 0;
@@ -8812,7 +8812,7 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
} else if (vms->deleted[x] && vmu->maxdeletedmsg) {
/* Move to deleted folder */
res = save_to_folder(vmu, vms, x, 10, NULL, 0);
if (res == ERROR_LOCK_PATH) {
if (res) {
/* If save failed do not delete the message */
vms->deleted[x] = 0;
vms->heard[x] = 0;