diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-09 17:24:40 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-09 17:24:40 +0000 |
commit | e7b0c65f0e5e7cd599421318c625eeec787867a6 (patch) | |
tree | 11d0ddb453cedb0a91edaf12c449c6b312a5ae0b /apps/app_voicemail.c | |
parent | ebf7b219107a38226134091e54570572b62001f2 (diff) |
Fix subscriptions to multiple mailboxes for ODBC_STORAGE. Also, leave a
comment for this to be fixed for IMAP_STORAGE, as well. I left IMAP alone
since I know MarkM was working on this code right now for another reason.
This is broken even worse in trunk, but for a different reason. The fact
that the mailbox option supported multiple mailboxes is completely not obvious
from the code in the channel drivers. Anyway, I will fix that in another
commit ...
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@78749 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 0150a41a3..bfbd803e2 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2253,17 +2253,16 @@ yuck: static int has_voicemail(const char *mailbox, const char *folder) { - char *context, tmp[256]; + char tmp[256], *tmp2 = tmp, *mbox, *context; ast_copy_string(tmp, mailbox, sizeof(tmp)); - if ((context = strchr(tmp, '@'))) - *context++ = '\0'; - else - context = "default"; - - if (messagecount(context, tmp, folder)) - return 1; - else - return 0; + while ((context = mbox = strsep(&tmp2, ","))) { + strsep(&context, "@"); + if (ast_strlen_zero(context)) + context = "default"; + if (messagecount(context, mbox, folder)) + return 1; + } + return 0; } #elif defined(IMAP_STORAGE) @@ -2483,6 +2482,8 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs) return 0; } +/*! XXX \todo Fix this function to support multiple mailboxes separated + * by commas */ static int has_voicemail(const char *mailbox, const char *folder) { int newmsgs, oldmsgs; |