[asterisk-commits] russell: trunk r78750 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 9 12:25:10 CDT 2007


Author: russell
Date: Thu Aug  9 12:25:09 2007
New Revision: 78750

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78750
Log:
Merged revisions 78749 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78749 | russell | 2007-08-09 12:24:40 -0500 (Thu, 09 Aug 2007) | 9 lines

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 ...

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=78750&r1=78749&r2=78750
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Aug  9 12:25:09 2007
@@ -2438,17 +2438,16 @@
 
 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)
@@ -2670,6 +2669,8 @@
  	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;




More information about the asterisk-commits mailing list