[asterisk-commits] tilghman: branch 1.6.2 r263590 - in /branches/1.6.2: ./ apps/app_voicemail.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon May 17 14:37:16 CDT 2010
Author: tilghman
Date: Mon May 17 14:37:11 2010
New Revision: 263590
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263590
Log:
Merged revisions 263589 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r263589 | tilghman | 2010-05-17 14:31:15 -0500 (Mon, 17 May 2010) | 9 lines
With IMAP backend, messages in INBOX were counted twice for MWI.
(closes issue #17135)
Reported by: edhorton
Patches:
20100513__issue17135.diff.txt uploaded by tilghman (license 14)
17135_2.diff uploaded by ebroad (license 878)
Tested by: edhorton, ebroad
........
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/apps/app_voicemail.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_voicemail.c?view=diff&rev=263590&r1=263589&r2=263590
==============================================================================
--- branches/1.6.2/apps/app_voicemail.c (original)
+++ branches/1.6.2/apps/app_voicemail.c Mon May 17 14:37:11 2010
@@ -1785,34 +1785,34 @@
static int folder_int(const char *folder)
{
/*assume a NULL folder means INBOX*/
- if (!folder)
+ if (!folder) {
return 0;
-#ifdef IMAP_STORAGE
- if (!strcasecmp(folder, imapfolder))
-#else
- if (!strcasecmp(folder, "INBOX"))
-#endif
+ }
+ if (!strcasecmp(folder, imapfolder)) {
return 0;
- else if (!strcasecmp(folder, "Old"))
+ } else if (!strcasecmp(folder, "Old")) {
return 1;
- else if (!strcasecmp(folder, "Work"))
+ } else if (!strcasecmp(folder, "Work")) {
return 2;
- else if (!strcasecmp(folder, "Family"))
+ } else if (!strcasecmp(folder, "Family")) {
return 3;
- else if (!strcasecmp(folder, "Friends"))
+ } else if (!strcasecmp(folder, "Friends")) {
return 4;
- else if (!strcasecmp(folder, "Cust1"))
+ } else if (!strcasecmp(folder, "Cust1")) {
return 5;
- else if (!strcasecmp(folder, "Cust2"))
+ } else if (!strcasecmp(folder, "Cust2")) {
return 6;
- else if (!strcasecmp(folder, "Cust3"))
+ } else if (!strcasecmp(folder, "Cust3")) {
return 7;
- else if (!strcasecmp(folder, "Cust4"))
+ } else if (!strcasecmp(folder, "Cust4")) {
return 8;
- else if (!strcasecmp(folder, "Cust5"))
+ } else if (!strcasecmp(folder, "Cust5")) {
return 9;
- else /*assume they meant INBOX if folder is not found otherwise*/
+ } else if (!strcasecmp(folder, "Urgent")) {
+ return 11;
+ } else { /*assume they meant INBOX if folder is not found otherwise*/
return 0;
+ }
}
static int __messagecount(const char *context, const char *mailbox, const char *folder)
@@ -1863,13 +1863,10 @@
if (vms_p) {
ast_debug(3, "Returning before search - user is logged in\n");
if (fold == 0) { /* INBOX */
- return vms_p->newmessages;
+ return urgent ? vms_p->urgentmessages : vms_p->newmessages;
}
if (fold == 1) { /* Old messages */
return vms_p->oldmessages;
- }
- if (fold == 11) {/*Urgent messages*/
- return vms_p->urgentmessages;
}
}
@@ -1893,7 +1890,7 @@
hdr = mail_newsearchheader ("X-Asterisk-VM-Extension", (char *)(!ast_strlen_zero(vmu->imapvmshareid) ? vmu->imapvmshareid : mailbox));
hdr->next = mail_newsearchheader("X-Asterisk-VM-Context", (char *) S_OR(context, "default"));
pgm->header = hdr;
- if (fold != 1) {
+ if (fold != OLD_FOLDER) {
pgm->unseen = 1;
pgm->seen = 0;
}
@@ -1905,9 +1902,14 @@
pgm->seen = 1;
}
/* look for urgent messages */
- if (urgent) {
- pgm->flagged = 1;
- pgm->unflagged = 0;
+ if (fold == NEW_FOLDER) {
+ if (urgent) {
+ pgm->flagged = 1;
+ pgm->unflagged = 0;
+ } else {
+ pgm->flagged = 0;
+ pgm->unflagged = 1;
+ }
}
pgm->undeleted = 1;
pgm->deleted = 0;
More information about the asterisk-commits
mailing list