aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-03-19 01:14:42 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-03-19 01:14:42 +0800
commit8dcf7b7853b02946ea5e7a5d94b6592781564774 (patch)
tree21b7d10fd892e9b77578fa4429cf522d55d04e8d
parentc54e95912887300be6d2145023c5287114c84ac3 (diff)
downloadgsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar.gz
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar.bz2
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar.lz
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar.xz
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.tar.zst
gsoc2013-evolution-8dcf7b7853b02946ea5e7a5d94b6592781564774.zip
rfc2047 decode the address here before passing it off to the addressbook
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. svn path=/trunk/; revision=25118
-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);