From e712cc248aef07ba3828362552f9e56bdf833a06 Mon Sep 17 00:00:00 2001 From: Antonio Xu Date: Wed, 2 Jul 2003 18:38:41 +0000 Subject: Change file url to absolute path. Fixes bug #44065. 2003-06-25 Antonio Xu * e-msg-composer.c (handle_mailto): Change file url to absolute path. Fixes bug #44065. svn path=/trunk/; revision=21726 --- composer/e-msg-composer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'composer/e-msg-composer.c') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f68b89341e..5ab4dba822 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -3827,6 +3827,7 @@ handle_mailto (EMsgComposer *composer, const char *mailto) size_t nread, nwritten; char *content; int len, clen; + CamelURL *url; /* Parse recipients (everything after ':' until '?' or eos). */ p = mailto + 7; @@ -3890,7 +3891,16 @@ handle_mailto (EMsgComposer *composer, const char *mailto) } } } else if (!strncasecmp (header, "attach", len)) { - e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), content); + /*Change file url to absolute path*/ + if (!strncasecmp (content, "file:", 5)) { + url = camel_url_new (content, NULL); + e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), + url->path); + camel_url_free (url); + } else { + e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), + content); + } } else { /* add an arbitrary header? */ e_msg_composer_add_header (composer, header, content); -- cgit v1.2.3