From bb1d2316f024efb5c232da21aff2c6b2ddcf711c Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 30 Apr 2002 19:31:37 +0000 Subject: Changed this to set a subject when sending a contact. This makes the 2002-04-30 Christopher James Lahey * backend/ebook/e-card.c (e_card_list_send): Changed this to set a subject when sending a contact. This makes the signature be set properly also. svn path=/trunk/; revision=16648 --- addressbook/ChangeLog | 6 ++++ addressbook/backend/ebook/e-card.c | 59 +++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index d482c0b440..4ece0600f0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2002-04-30 Christopher James Lahey + + * backend/ebook/e-card.c (e_card_list_send): Changed this to set a + subject when sending a contact. This makes the signature be set + properly also. + 2002-04-26 Jeffrey Stedfast * printing/Makefile.am: Don't link to libibex anymore. diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index b3beecbc7e..4fd0bb623d 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -2648,7 +2648,6 @@ e_card_list_send (GList *cards, ECardDisposition disposition) cards = g_list_next (cards); } - subject = CORBA_string_dup (""); GNOME_Evolution_Composer_setHeaders (composer_server, to_list, cc_list, bcc_list, subject, &ev); @@ -2669,6 +2668,9 @@ e_card_list_send (GList *cards, ECardDisposition disposition) GNOME_Evolution_Composer_AttachmentData *attach_data; CORBA_boolean show_inline; char *tempstr; + + GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list; + CORBA_char *subject; content_type = CORBA_string_dup ("text/x-vcard"); filename = CORBA_string_dup (""); @@ -2711,6 +2713,61 @@ e_card_list_send (GList *cards, ECardDisposition disposition) CORBA_free (filename); CORBA_free (description); CORBA_free (attach_data); + + to_list = GNOME_Evolution_Composer_RecipientList__alloc (); + to_list->_maximum = to_list->_length = 0; + + cc_list = GNOME_Evolution_Composer_RecipientList__alloc (); + cc_list->_maximum = cc_list->_length = 0; + + bcc_list = GNOME_Evolution_Composer_RecipientList__alloc (); + bcc_list->_maximum = bcc_list->_length = 0; + + if (!cards || cards->next) { + subject = CORBA_string_dup ("Contact information"); + } else { + ECard *card = cards->data; + const gchar *tempstr2; + + tempstr2 = NULL; + gtk_object_get(GTK_OBJECT(card), + "file_as", &tempstr2, + NULL); + if (!tempstr2 || !*tempstr2) + gtk_object_get(GTK_OBJECT(card), + "full_name", &tempstr2, + NULL); + if (!tempstr2 || !*tempstr2) + gtk_object_get(GTK_OBJECT(card), + "org", &tempstr2, + NULL); + if (!tempstr2 || !*tempstr2) { + EList *list; + EIterator *iterator; + gtk_object_get(GTK_OBJECT(card), + "email", &list, + NULL); + iterator = e_list_get_iterator (list); + if (e_iterator_is_valid (iterator)) { + tempstr2 = e_iterator_get (iterator); + } + gtk_object_unref (GTK_OBJECT (iterator)); + } + + if (!tempstr2 || !*tempstr2) + tempstr = g_strdup_printf ("Contact information"); + else + tempstr = g_strdup_printf ("Contact information for %s", tempstr2); + subject = CORBA_string_dup (tempstr); + g_free (tempstr); + } + + GNOME_Evolution_Composer_setHeaders (composer_server, to_list, cc_list, bcc_list, subject, &ev); + + CORBA_free (to_list); + CORBA_free (cc_list); + CORBA_free (bcc_list); + CORBA_free (subject); } GNOME_Evolution_Composer_show (composer_server, &ev); -- cgit v1.2.3