]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 180464 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Thu, 5 Mar 2009 23:26:58 +0000 (23:26 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 5 Mar 2009 23:26:58 +0000 (23:26 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180464 | mmichelson | 2009-03-05 17:26:11 -0600 (Thu, 05 Mar 2009) | 16 lines

  [IMAP] Fix message retrieval issues when identical mailbox names were defined in separate contexts.

  There was a fix put in a while back so that an X-Asterisk-VM-Context message header was
  added to stored IMAP voicemails. This would allow for us to differentiate if the same
  mailbox name was used in multiple contexts. The problem still left was that not all places
  where messages were retrieved actually attempted to use this header for information when
  retrieving messages. This commit fixes that so that MWI and message retrieval from VoiceMailMain
  work as expected.

  (closes issue #13853)
  Reported by: vicks1
  Patches:
        13853_v2.patch uploaded by mmichelson (license 60)
  Tested by: lmadsen
........

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

apps/app_voicemail.c

index 4cca3156eb2eb5e36f9d805f0b3a56fda5be2e8f..2388ad4e734113f61add9599718906dced67bb9f 100644 (file)
@@ -1804,6 +1804,7 @@ static int messagecount(const char *context, const char *mailbox, const char *fo
                ast_mutex_lock(&vms_p->lock);
                pgm = mail_newsearchpgm ();
                hdr = mail_newsearchheader ("X-Asterisk-VM-Extension", (char *)(!ast_strlen_zero(vmu->imapvmshareid) ? vmu->imapvmshareid : mailbox));
+               hdr->next = mail_newsearchheader("X-Asterisk-VM-Context", S_OR(context, "default"));
                pgm->header = hdr;
                if (fold != 1) {
                        pgm->unseen = 1;
@@ -2251,6 +2252,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
 
        /* Check IMAP folder for Asterisk messages only... */
        hdr = mail_newsearchheader("X-Asterisk-VM-Extension", (!ast_strlen_zero(vmu->imapvmshareid) ? vmu->imapvmshareid : vmu->mailbox));
+       hdr->next = mail_newsearchheader("X-Asterisk-VM-Context", vmu->context);
        pgm->header = hdr;
        pgm->deleted = 0;
        pgm->undeleted = 1;