aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-24 22:58:54 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-24 22:58:54 +0000
commitc4e8e1fb89e76a4922a15e25eecd73c89ff8188f (patch)
treed6a56b326d31730efe997bfcf58037aff5c81cb3 /apps
parent84933f21841e667d4f4fa5d629ecbae303e8c26a (diff)
Make deletion of temporary greetings work properly with IMAP_STORAGE
This same patch was merged in 220833, but was skipped in this branch erroneously. (closes issue #16170) Reported by: francesco_r git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@248668 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ce8509cab..1f176a286 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -133,7 +133,7 @@ static int init_mailstream (struct vm_state *vms, int box);
static void write_file (char *filename, char *buffer, unsigned long len);
/*static void status (MAILSTREAM *stream); */ /* No need for this. */
static char *get_header_by_tag(char *header, char *tag);
-static void vm_imap_delete(int msgnum, struct ast_vm_user *vmu);
+static void vm_imap_delete(char *file, int msgnum, struct ast_vm_user *vmu);
static char *get_user_by_mailbox(char *mailbox);
static struct vm_state *get_vm_state_by_imapuser(char *user, int interactive);
static struct vm_state *get_vm_state_by_mailbox(const char *mailbox, const char *context, int interactive);
@@ -477,7 +477,7 @@ static char odbc_table[80];
#define EXISTS(a,b,c,d) (ast_fileexists(c,NULL,d) > 0)
#define RENAME(a,b,c,d,e,f,g,h) (rename_file(g,h));
#define COPY(a,b,c,d,e,f,g,h) (copy_file(g,h));
-#define DELETE(a,b,c,d) (vm_imap_delete(b,d))
+#define DELETE(a,b,c,d) (vm_imap_delete(a,b,d))
#else
#define RETRIEVE(a,b,c)
#define DISPOSE(a,b)
@@ -1062,14 +1062,15 @@ static void free_user(struct ast_vm_user *vmu)
/* All IMAP-specific functions should go in this block. This
* keeps them from being spread out all over the code */
#ifdef IMAP_STORAGE
-static void vm_imap_delete(int msgnum, struct ast_vm_user *vmu)
+static void vm_imap_delete(char *file, int msgnum, struct ast_vm_user *vmu)
{
char arg[10];
struct vm_state *vms;
unsigned long messageNum;
- /* Greetings aren't stored in IMAP, so we can't delete them there */
+ /* Greetings aren't stored in IMAP, so we delete them from disk */
if (msgnum < 0) {
+ ast_filedelete(file, NULL);
return;
}
@@ -1091,6 +1092,7 @@ static void vm_imap_delete(int msgnum, struct ast_vm_user *vmu)
snprintf (arg, sizeof(arg), "%lu",messageNum);
ast_mutex_lock(&vms->lock);
mail_setflag (vms->mailstream,arg,"\\DELETED");
+ mail_expunge(vms->mailstream);
ast_mutex_unlock(&vms->lock);
}