aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-21 08:14:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-02-03 07:29:47 +0800
commit6db981fa566574d16f4664687d26147acde7ad80 (patch)
tree3b233b5a2876db9983153b8cc3c02a49270600a3 /mail
parent0727097ac13ad746184ba0580247bff70cefbb68 (diff)
downloadgsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar.gz
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar.bz2
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar.lz
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar.xz
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.tar.zst
gsoc2013-evolution-6db981fa566574d16f4664687d26147acde7ad80.zip
Bug 607520 - 'Add to Address Book' fails when address has space
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index c94749b5a5..c5106b6c23 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -105,9 +105,11 @@ action_add_to_address_book_cb (GtkAction *action,
EShell *shell;
EShellBackend *shell_backend;
EMFormatHTMLDisplay *html_display;
+ CamelInternetAddress *cia;
EWebView *web_view;
CamelURL *curl;
const gchar *uri;
+ gchar *email;
/* This action is defined in EMailDisplay. */
@@ -125,11 +127,23 @@ action_add_to_address_book_cb (GtkAction *action,
if (curl->path == NULL || *curl->path == '\0')
goto exit;
+ cia = camel_internet_address_new ();
+ if (camel_address_decode (CAMEL_ADDRESS (cia), curl->path) < 0) {
+ camel_object_unref (cia);
+ goto exit;
+ }
+
+ email = camel_address_format (CAMEL_ADDRESS (cia));
+
/* XXX EBookShellBackend should be listening for this
* event. Kind of kludgey, but works for now. */
shell = e_shell_backend_get_shell (shell_backend);
- e_shell_event (shell, "contact-quick-add-email", curl->path);
+ e_shell_event (shell, "contact-quick-add-email", email);
emu_remove_from_mail_cache_1 (curl->path);
+
+ camel_object_unref (cia);
+ g_free (email);
+
exit:
camel_url_free (curl);
}