aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 14:43:19 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 14:43:19 +0000
commit74561c1a36a0e600422462c36ef1afa8d1579c55 (patch)
tree7336452d354ffae864cff119ea7895d86b24beb9 /apps
parent33a673220343c0f4663f32f6137c008129e01851 (diff)
Merged revisions 135067-135068 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r135067 | mmichelson | 2008-08-01 09:29:48 -0500 (Fri, 01 Aug 2008) | 13 lines IMAP storage functioned under the assumption that folders such as "Work" and "Family" would be subfolders of the INBOX. This is an invalid assumption to make, but it could be desirable to set up folders in this manner, so a new option for voicemail.conf, "imapparentfolder" has been added to allow for this. (closes issue #13142) Reported by: jaroth Patches: parentfolder.patch uploaded by jaroth (license 50) ........ r135068 | mmichelson | 2008-08-01 09:42:24 -0500 (Fri, 01 Aug 2008) | 3 lines IMAP-specific items must go in IMAP_STORAGE defines... ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@135070 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index b9b662bee..8b57b6b43 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -124,6 +124,7 @@ static char imapserver[48];
static char imapport[8];
static char imapflags[128];
static char imapfolder[64];
+static char imapparentfolder[64] = "\0";
static char greetingfolder[64];
static char authuser[32];
static char authpassword[42];
@@ -5100,8 +5101,13 @@ static void imap_mailbox_name(char *spec, size_t len, struct vm_state *vms, int
snprintf(spec, len, "%s%s", tmp, use_folder? imapfolder: "INBOX");
else if (box == GREETINGS_FOLDER)
snprintf(spec, len, "%s%s", tmp, greetingfolder);
- else
- snprintf(spec, len, "%s%s%c%s", tmp, imapfolder, delimiter, mbox(box));
+ else /* Other folders such as Friends, Family, etc... */
+ if (!ast_strlen_zero(imapparentfolder)) {
+ /* imapparentfolder would typically be set to INBOX */
+ snprintf(spec, len, "%s%s%c%s", tmp, imapparentfolder, delimiter, mbox(box));
+ } else {
+ snprintf(spec, len, "%s%s", tmp, mbox(box));
+ }
}
static int init_mailstream(struct vm_state *vms, int box)
@@ -8300,7 +8306,9 @@ static int load_config(int reload)
ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
ucfg = ast_config_load("users.conf", config_flags);
}
-
+#ifdef IMAP_STORAGE
+ ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
+#endif
/* set audio control prompts */
strcpy(listen_control_forward_key, DEFAULT_LISTEN_CONTROL_FORWARD_KEY);
strcpy(listen_control_reverse_key, DEFAULT_LISTEN_CONTROL_REVERSE_KEY);
@@ -8448,6 +8456,9 @@ static int load_config(int reload)
} else {
ast_copy_string(imapfolder, "INBOX", sizeof(imapfolder));
}
+ if ((val = ast_variable_retrieve(cfg, "general", "imapparentfolder"))) {
+ ast_copy_string(imapparentfolder, val, sizeof(imapparentfolder));
+ }
if ((val = ast_variable_retrieve(cfg, "general", "imapgreetings"))) {
imapgreetings = ast_true(val);
} else {