diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-17 17:52:50 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-17 17:52:50 +0000 |
commit | a67d60989e96323ee5cb7f97896d852ebce9f26b (patch) | |
tree | 716a0d8c7fa500d5b802c719d098c18f5ff2d6a8 | |
parent | 377b65f1df5f8e08c934de34aa32bdfb2c7b5760 (diff) |
Use the create_vm_state_from_user function in a place where
it was not being used before. Also, I've moved the urgent
folder check in messagecount() up a bit so that the flow is
a bit better.
This was something I noticed while taking a look at issue
#13973, although I don't think this is the underlying cause
of the issue.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165142 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index fc2a5244c..7286a7bd6 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1702,6 +1702,12 @@ static int messagecount(const char *context, const char *mailbox, const char *fo int fold = folder_int(folder); int urgent = 0; + /* If URGENT, then look at INBOX */ + if (fold == 11) { + fold = NEW_FOLDER; + urgent = 1; + } + if (ast_strlen_zero(mailbox)) return 0; @@ -1749,25 +1755,8 @@ static int messagecount(const char *context, const char *mailbox, const char *fo vms_p = get_vm_state_by_mailbox(mailbox, context, 0); } - /* If URGENT, then look at INBOX */ - if (fold == 11) { - fold = NEW_FOLDER; - urgent = 1; - } - if (!vms_p) { - ast_debug(3,"Adding new vmstate for %s\n",vmu->imapuser); - if (!(vms_p = ast_calloc(1, sizeof(*vms_p)))) { - return -1; - } - ast_copy_string(vms_p->imapuser,vmu->imapuser, sizeof(vms_p->imapuser)); - ast_copy_string(vms_p->username, mailbox, sizeof(vms_p->username)); /* save for access from interactive entry point */ - vms_p->mailstream = NIL; /* save for access from interactive entry point */ - ast_debug(3, "Copied %s to %s\n",vmu->imapuser,vms_p->imapuser); - vms_p->updated = 1; - ast_copy_string(vms_p->curbox, mbox(fold), sizeof(vms_p->curbox)); - init_vm_state(vms_p); - vmstate_insert(vms_p); + create_vm_state_from_user(vmu); } ret = init_mailstream(vms_p, fold); if (!vms_p->mailstream) { |