aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-23 03:14:05 +0800
committerDan Winship <danw@src.gnome.org>2001-05-23 03:14:05 +0800
commit35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3 (patch)
tree3b5c079aa448ec3f9e3eca04c9a72e48d12dd2d2
parente16ec956d76ab269e645e4c6d2f3eb5fbc01c027 (diff)
downloadgsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar.gz
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar.bz2
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar.lz
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar.xz
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.tar.zst
gsoc2013-evolution-35f5f53a11ba1d7a8d648a0f4ee7e590a071d6d3.zip
If http mode is HTTP_SOMETIMES, use e_book_query_address_locally to check
* mail-display.c (on_url_requested): If http mode is HTTP_SOMETIMES, use e_book_query_address_locally to check the From address and load images if it's found. * mail-config.c (config_read): Default http_mode to MAIL_CONFIG_HTTP_SOMETIMES. Fix typo to make default forward style actually work. svn path=/trunk/; revision=9936
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-config.c4
-rw-r--r--mail/mail-display.c41
3 files changed, 46 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 6b89aac7f4..cfe9b1cdbc 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2001-05-22 Dan Winship <danw@ximian.com>
+
+ * mail-display.c (on_url_requested): If http mode is
+ HTTP_SOMETIMES, use e_book_query_address_locally to check the From
+ address and load images if it's found.
+
+ * mail-config.c (config_read): Default http_mode to
+ MAIL_CONFIG_HTTP_SOMETIMES. Fix typo to make default forward style
+ actually work.
+
2001-05-22 Jeffrey Stedfast <fejj@ximian.com>
* Makefile.am: Use MAILER_CFLAGS and MAILER_LIBS.
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 420ae587af..1560e6e602 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -458,11 +458,11 @@ config_read (void)
evolution_dir);
config->http_mode = gnome_config_get_int_with_default (str, &def);
if (def)
- config->http_mode = MAIL_CONFIG_HTTP_NEVER;
+ config->http_mode = MAIL_CONFIG_HTTP_SOMETIMES;
g_free (str);
/* Forwarding */
- str = g_strdup_printf ("=%s/config/Mail=/Format/defaul_forward_style",
+ str = g_strdup_printf ("=%s/config/Mail=/Format/default_forward_style",
evolution_dir);
config->default_forward_style = gnome_config_get_int_with_default (str, &def);
if (def)
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 87ca5fd1dd..dd50e4d4cd 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -35,7 +35,8 @@
#include <gtkhtml/htmltext.h> /* XXX */
#include <gtkhtml/htmlinterval.h> /* XXX */
-#include <e-util/e-html-utils.h>
+#include "e-util/e-html-utils.h"
+#include "addressbook/backend/ebook/e-book-util.h"
#include "e-searching-tokenizer.h"
#include "mail-display.h"
@@ -888,6 +889,21 @@ load_http (MailDisplay *md, gpointer data)
}
static void
+ebook_callback (EBook *book, const gchar *addr, ECard *card, gpointer data)
+{
+ MailDisplay *md = data;
+
+ if (card && md->current_message) {
+ const CamelInternetAddress *from = camel_mime_message_get_from (md->current_message);
+ const char *md_name, *md_addr;
+
+ if (camel_internet_address_get (from, 0, &md_name, &md_addr) &&
+ !strcmp (addr, md_addr))
+ mail_display_load_images (md);
+ }
+}
+
+static void
on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
gpointer user_data)
{
@@ -936,12 +952,23 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
}
/* See if it's something we can load. */
- if (strncmp (url, "http:", 5) == 0 &&
- (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS ||
- g_datalist_get_data (md->data, "load_images"))) {
- ba = g_byte_array_new ();
- g_hash_table_insert (urls, g_strdup (url), ba);
- mail_display_redisplay_when_loaded (md, ba, load_http, g_strdup (url));
+ if (strncmp (url, "http:", 5) == 0) {
+ if (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS ||
+ g_datalist_get_data (md->data, "load_images")) {
+ ba = g_byte_array_new ();
+ g_hash_table_insert (urls, g_strdup (url), ba);
+ mail_display_redisplay_when_loaded (md, ba, load_http,
+ g_strdup (url));
+ } else if (mail_config_get_http_mode () == MAIL_CONFIG_HTTP_SOMETIMES &&
+ !g_datalist_get_data (md->data, "checking_from")) {
+ const CamelInternetAddress *from = camel_mime_message_get_from (md->current_message);
+ const char *name, *addr;
+
+ g_datalist_set_data (md->data, "checking_from",
+ GINT_TO_POINTER (1));
+ if (camel_internet_address_get (from, 0, &name, &addr))
+ e_book_query_address_locally (addr, ebook_callback, md);
+ }
}
gtk_html_end (html, handle, GTK_HTML_STREAM_ERROR);