diff options
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r-- | mail/mail-tools.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 2b4061ed63..c2e4d33e06 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -448,3 +448,26 @@ mail_tools_x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray ** return folder; } + + +char * +mail_tools_folder_to_url (CamelFolder *folder) +{ + char *service_url, *url; + const char *full_name; + CamelService *service; + + g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL); + + full_name = folder->full_name; + while (*full_name == '/') + full_name++; + + service = (CamelService *) folder->parent_store; + service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL); + url = g_strdup_printf ("%s%s%s", service_url, service_url[strlen (service_url)-1] != '/' ? "/" : "", + full_name); + g_free (service_url); + + return url; +} |