diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-02-27 08:01:09 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-02-27 08:01:09 +0800 |
commit | 22ac1344f7dff17a6761e2c2826baa37dad864fd (patch) | |
tree | 72fdf2b1022a2dba2463f17dc4a0cd26794b62e5 /mail/mail-format.c | |
parent | 9001aaa2f36f58125c46ccedaad4043213c5767a (diff) | |
download | gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.tar.gz gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.tar.zst gsoc2013-evolution-22ac1344f7dff17a6761e2c2826baa37dad864fd.zip |
Get the Content-Base if the header exists and use gtk_html_set_base to set
2002-02-26 Jeffrey Stedfast <fejj@ximian.com>
* mail-format.c (handle_text_html): Get the Content-Base if the
header exists and use gtk_html_set_base to set this base url.
* mail-display.c (on_link_clicked): No longer need to calculate
the full url. This is now handled by GtkHTML.
(on_set_base): Removed.
(on_url_requested): No longer need to calculate the full url.
(mail_display_initialize_gtkhtml): Don't connect to the set_base
signal anymore. We don't care.
* mail-display.h: No longer need base_url (it was broken anyway).
svn path=/trunk/; revision=15850
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index 4b315643b4..a6e8748d0b 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1629,10 +1629,27 @@ static gboolean handle_text_html (CamelMimePart *part, const char *mime_type, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream) { - const char *location; + const char *location, *base; mail_html_write (html, stream, "\n<!-- text/html -->\n"); + if ((base = camel_medium_get_header (CAMEL_MEDIUM (part), "Content-Base"))) { + char *base_url; + size_t len; + + len = strlen (base); + + if (*base == '"' && *(base + len - 1) == '"') { + len -= 2; + base_url = alloca (len + 1); + memcpy (base_url, base + 1, len); + base_url[len] = '\0'; + base = base_url; + } + + gtk_html_set_base (html, base); + } + /* FIXME: deal with relative URLs */ location = get_location (part, md); if (!location) |