]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Let vm_mailbox_snapshot combine "Urgent" when no folder is specified
authorMatthew Jordan <mjordan@digium.com>
Thu, 7 Mar 2013 17:57:08 +0000 (17:57 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 7 Mar 2013 17:57:08 +0000 (17:57 +0000)
r381835 fixed a bug in vm_mailbox_snapshot where combining INBOX and Old forgot
that Urgent also "counts" as new messages. This fixed the problem when any of
the three folders was specified and the combine option was used.

It missed the case where the folder isn't specified and we build a snapshot of
all folders. This patch corrects that.

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

apps/app_voicemail.c

index 6af5dfc8d266db82db78a0bc3326d6e7bcd98bd4..a7d08c523f9c13ec2e7daa0108445df3e93a1368 100644 (file)
@@ -15021,10 +15021,12 @@ static struct ast_vm_mailbox_snapshot *vm_mailbox_snapshot_create(const char *ma
                int combining_old = 0;
                /* Assume we are combining folders if:
                 *  - The current index is the old folder index OR
-                *  - The current index is urgent and we were looking for INBOX OR
-                *  - The current index is INBOX and we were looking for Urgent
+                *  - The current index is urgent and we were looking for INBOX or all folders OR
+                *  - The current index is INBOX and we were looking for Urgent or all folders
                 */
-               if ((i == old_index || (i == urgent_index && this_index_only == inbox_index) || (i == inbox_index && this_index_only == urgent_index)) && (combine_INBOX_and_OLD)) {
+               if ((i == old_index ||
+                       (i == urgent_index && (this_index_only == inbox_index || this_index_only == -1)) ||
+                       (i == inbox_index && (this_index_only == urgent_index || this_index_only == -1))) && (combine_INBOX_and_OLD)) {
                        combining_old = 1;
                }