diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-21 19:59:45 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-21 19:59:45 +0000 |
commit | 1dad680186522e4df6a0c0fbf87428348e7dfc96 (patch) | |
tree | 1e29cc0d952c775f0c4774e69ec08ed26a79af0b /apps | |
parent | 4c2a51057eb2498853676592e06666e33d4491da (diff) |
The mail_copy c-client function does not expect a full imap mailbox string, just the name of the mailbox.
(closes issue #11419, reported and patched by jaroth, with additional patchwork from me)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index fec54fcab..d7c064405 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2562,7 +2562,6 @@ static int has_voicemail(const char *mailbox, const char *folder) static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir) { - char dest[256]; struct vm_state *sendvms = NULL, *destvms = NULL; char messagestring[10]; /*I guess this could be a problem if someone has more than 999999999 messages...*/ if(msgnum >= recip->maxmsg) { @@ -2579,9 +2578,8 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i ast_log(LOG_ERROR, "Couldn't get vm_state for destination mailbox!\n"); return -1; } - imap_mailbox_name(dest, sizeof(dest), destvms, imbox, 1); snprintf(messagestring, sizeof(messagestring), "%ld", sendvms->msgArray[msgnum]); - if((mail_copy(sendvms->mailstream, messagestring, dest) == T)) + if((mail_copy(sendvms->mailstream, messagestring, (char *) mbox(imbox)) == T)) return 0; ast_log(LOG_WARNING, "Unable to copy message from mailbox %s to mailbox %s\n", vmu->mailbox, recip->mailbox); return -1; @@ -3220,7 +3218,6 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg #ifdef IMAP_STORAGE /* we must use mbox(x) folder names, and copy the message there */ /* simple. huh? */ - char dbox[256]; long res; char sequence[10]; @@ -3228,10 +3225,9 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg if (box == 1) return 10; /* get the real IMAP message number for this message */ snprintf(sequence, sizeof(sequence), "%ld", vms->msgArray[msg]); - imap_mailbox_name(dbox, sizeof(dbox), vms, box, 1); if(option_debug > 2) - ast_log(LOG_DEBUG, "Copying sequence %s to mailbox %s\n",sequence,dbox); - res = mail_copy(vms->mailstream,sequence,dbox); + ast_log(LOG_DEBUG, "Copying sequence %s to mailbox %s\n",sequence,(char *) mbox(box)); + res = mail_copy(vms->mailstream,sequence,(char *) mbox(box)); if (res == 1) return 0; return 1; #else |