[asterisk-commits] mmichelson: trunk r78908 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 9 18:49:06 CDT 2007


Author: mmichelson
Date: Thu Aug  9 18:49:05 2007
New Revision: 78908

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

........
r78907 | mmichelson | 2007-08-09 18:47:00 -0500 (Thu, 09 Aug 2007) | 4 lines

Improved a bit of logic regarding comma-separated mailboxes in has_voicemail. Also added some braces to some compound if statements
since unbraced if statements scare me in general.


........

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=78908&r1=78907&r2=78908
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Thu Aug  9 18:49:05 2007
@@ -2702,14 +2702,16 @@
 		context = "default";
 		mailboxnc = (char *)mailbox_context;
 	}
-	if (newmsgs)
+	if (newmsgs) {
 		if((*newmsgs = messagecount(context, mailboxnc, "INBOX")) < 0)
 			return -1;
-	if (oldmsgs)
+	}
+	if (oldmsgs) {
 		if((*oldmsgs = messagecount(context, mailboxnc, "Old")) < 0)
 			return -1;
- 	return 0;
- }
+	}
+	return 0;
+}
 	
 
 static int has_voicemail(const char *mailbox, const char *folder)
@@ -2717,9 +2719,13 @@
 	char tmp[256], *tmp2, *mbox, *context;
 	ast_copy_string(tmp, mailbox, sizeof(tmp));
 	tmp2 = tmp;
-	while (strcmp((mbox = strsep(&tmp2, ",")), mailbox)) {
-		if (has_voicemail(mbox, folder))
-			return 1;
+	if(strchr(tmp2, ',')) {
+		while((mbox = strsep(&tmp2, ","))) {
+			if(!ast_strlen_zero(mbox)) {
+				if (has_voicemail(mbox, folder))
+					return 1;
+			}
+		}
 	}
 	if ((context= strchr(tmp, '@')))
 		*context++ = '\0';




More information about the asterisk-commits mailing list