From 2bc7669d539114cb4b4cf19a590abaabcd9e8748 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Sat, 2 Jul 2005 14:59:49 +0000 Subject: Fixes the problem in sending the meeting to the mailing list if the list does not contain email ids. svn path=/trunk/; revision=29619 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/e-meeting-list-view.c | 13 ++++++++++++- calendar/gui/e-select-names-editable.c | 11 ++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 5ae59c0910..976c414faa 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2005-07-02 Chenthill Palanisamy + + * gui/e-meeting-list-view.c: (process_section): + * gui/e-select-names-editable.c: + (e_select_names_editable_get_emails): If the contact list + does not have all the mail ids, use the name of the contact + list as the email id. + 2005-07-01 Chenthill Palanisamy * gui/e-cal-model.c: (e_cal_model_class_init), diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 3e91bea40c..d3eca7dfc2 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -537,6 +537,7 @@ static void process_section (EMeetingListView *view, GList *destinations, icalparameter_role role) { EMeetingListViewPrivate *priv; + gboolean contact_list = FALSE; GList *l; priv = view->priv; @@ -548,6 +549,11 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role if (e_destination_is_evolution_list (destination)) { list_dests = e_destination_list_get_dests (destination); } else { + /* check if the contact is contact list which is not expanded yet */ + /* we dont expand it currently, TODO do we need to expand it by default */ + if (e_contact_get (e_destination_get_contact (destination), E_CONTACT_IS_LIST)) + contact_list = TRUE; + card_dest.next = NULL; card_dest.prev = NULL; card_dest.data = destination; @@ -581,7 +587,12 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role /* If we couldn't get the attendee prior, get the email address as the default */ if (attendee == NULL || *attendee == '\0') { - attendee = e_destination_get_email (dest); + /* If its a contact_list which is not expanded it wont have a email id, + so we can use the name as the email id */ + if (!contact_list) + attendee = e_destination_get_email (dest); + else + attendee = e_destination_get_name (dest); } if (attendee == NULL || *attendee == '\0') diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 10781150d1..67d1c7dab5 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -132,6 +132,7 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) GList *destinations; EDestination *destination; GList *result = NULL; + gboolean contact_list = FALSE; g_return_val_if_fail (E_SELECT_NAMES_EDITABLE (esne), NULL); @@ -149,7 +150,15 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) result = g_list_append (result, g_strdup (e_destination_get_email (l->data))); } } else { - result = g_list_append (result, g_strdup (e_destination_get_email (destination))); + /* check if the contact is contact list, it does not contain all the email ids */ + /* we dont expand it currently, TODO do we need to expand it by getting it from addressbook*/ + if (e_contact_get (e_destination_get_contact (destination), E_CONTACT_IS_LIST)) { + /* If its a contact_list which is not expanded, it wont have a email id, + so we can use the name as the email id */ + + result = g_list_append (result, g_strdup (e_destination_get_name (destination))); + } else + result = g_list_append (result, g_strdup (e_destination_get_email (destination))); } g_list_free (destinations); -- cgit