aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-utils.c16
2 files changed, 20 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 40691ec27a..f27d37f484 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-18 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-utils.c (em_utils_add_address): rfc2047 decode the address
+ here before passing it off to the addressbook (which expects it to
+ be in human-readable form, not encoded). Fixes bug #55591.
+
2004-03-18 Not Zed <NotZed@Ximian.com>
* mail-account-gui.c (mail_account_gui_new): save the source and
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 6e79386f37..303b64fac4 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1616,15 +1616,27 @@ emu_add_address_cb(BonoboListener *listener, const char *name, const CORBA_any *
**/
void em_utils_add_address(struct _GtkWidget *parent, const char *email)
{
+ CamelInternetAddress *cia;
GtkWidget *win;
GtkWidget *control;
/*GtkWidget *socket;*/
-
+ char *buf;
+
+ cia = camel_internet_address_new ();
+ if (camel_address_decode ((CamelAddress *) cia, email) == -1) {
+ camel_object_unref (cia);
+ return;
+ }
+
+ buf = camel_address_format ((CamelAddress *) cia);
+ camel_object_unref (cia);
+
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title((GtkWindow *)win, _("Add address"));
control = bonobo_widget_new_control("OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION, CORBA_OBJECT_NIL);
- bonobo_widget_set_property((BonoboWidget *)control, "email", TC_CORBA_string, email, NULL);
+ bonobo_widget_set_property((BonoboWidget *)control, "email", TC_CORBA_string, buf, NULL);
+ g_free (buf);
bonobo_event_source_client_add_listener(bonobo_widget_get_objref((BonoboWidget *)control), emu_add_address_cb, NULL, NULL, win);