From 22ac1344f7dff17a6761e2c2826baa37dad864fd Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 27 Feb 2002 00:01:09 +0000 Subject: Get the Content-Base if the header exists and use gtk_html_set_base to set 2002-02-26 Jeffrey Stedfast * 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 --- mail/mail-format.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mail/mail-format.c') 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\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) -- cgit v1.2.3