Merged revisions 78450 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Tue, 7 Aug 2007 19:44:46 +0000 (19:44 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 7 Aug 2007 19:44:46 +0000 (19:44 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78450 | mmichelson | 2007-08-07 14:43:57 -0500 (Tue, 07 Aug 2007) | 5 lines

The logic behind inboxcount's return value was reversed in has_voicemail and message_count.

(closes issue #10401, reported by st1710, patched by me)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78451 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index d4e7ea4..ae2fa2f 100644 (file)
@@ -2675,9 +2675,9 @@ static int has_voicemail(const char *mailbox, const char *folder)
        int newmsgs, oldmsgs;
        
        if(inboxcount(mailbox, &newmsgs, &oldmsgs))
-               return folder? oldmsgs: newmsgs;
-       else
                return 0;
+       else
+               return folder? oldmsgs: newmsgs;
 }
 
 static int messagecount(const char *context, const char *mailbox, const char *folder)
@@ -2690,9 +2690,9 @@ static int messagecount(const char *context, const char *mailbox, const char *fo
        sprintf(tmp,"%s@%s", mailbox, ast_strlen_zero(context)? "default": context);
 
        if(inboxcount(tmp, &newmsgs, &oldmsgs))
-               return folder? oldmsgs: newmsgs;
-       else
                return 0;
+       else
+               return folder? oldmsgs: newmsgs;
 }
 
 #endif