aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-27 21:26:38 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-27 23:59:55 +0800
commitd509f21104b58e7e255807c40cb19c1831e81cbd (patch)
treee9ee36562d10d6d33c05bd36ca519c2895070813 /mail
parentc6bda27c9c3120c953a728917e6370e88089d377 (diff)
downloadgsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar.gz
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar.bz2
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar.lz
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar.xz
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.tar.zst
gsoc2013-evolution-d509f21104b58e7e255807c40cb19c1831e81cbd.zip
EHTTPRequest: Use e_mail_ui_session_check_known_address_sync().
Use e_mail_ui_session_check_known_address_sync() to help determine whether to automatically display images in a text/html MIME part.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-http-request.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index 5c4b638ac8..0d6ccc26a1 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -37,6 +37,8 @@
#include <shell/e-shell.h>
+#include "e-mail-ui-session.h"
+
#define d(x)
#define E_HTTP_REQUEST_GET_PRIVATE(obj) \
@@ -288,17 +290,34 @@ handle_http_request (GSimpleAsyncResult *res,
part_list = camel_object_bag_get (registry, decoded_uri);
if (part_list) {
- EShell *shell;
- ESourceRegistry *registry;
+ EShellBackend *shell_backend;
+ EMailBackend *backend;
+ EMailSession *session;
CamelInternetAddress *addr;
CamelMimeMessage *message;
+ gboolean known_address = FALSE;
+ GError *error = NULL;
+
+ shell_backend =
+ e_shell_get_backend_by_name (shell, "mail");
+ backend = E_MAIL_BACKEND (shell_backend);
+ session = e_mail_backend_get_session (backend);
- shell = e_shell_get_default ();
- registry = e_shell_get_registry (shell);
message = e_mail_part_list_get_message (part_list);
addr = camel_mime_message_get_from (message);
- force_load_images = em_utils_in_addressbook (
- registry, addr, FALSE, cancellable);
+
+ e_mail_ui_session_check_known_address_sync (
+ E_MAIL_UI_SESSION (session),
+ addr, FALSE, cancellable,
+ &known_address, &error);
+
+ if (error != NULL) {
+ g_warning ("%s: %s", G_STRFUNC, error->message);
+ g_error_free (error);
+ }
+
+ if (known_address)
+ force_load_images = TRUE;
g_object_unref (part_list);
}