]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Voicemail API: fix handling of full mailbox
authorScott Griepentrog <sgriepentrog@digium.com>
Tue, 7 Apr 2015 19:34:35 +0000 (19:34 +0000)
committerScott Griepentrog <sgriepentrog@digium.com>
Tue, 7 Apr 2015 19:34:35 +0000 (19:34 +0000)
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

apps/app_voicemail.c

index 9bb0d9ecc7cf2a2debe11062df15b5de2b3ef535..d5b1dc58d1aae9a6756bcacfb39a72b31515ea9c 100644 (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;