- resolved_contacts = select_contacts_for_name_dialog (address, external_contacts);
-
- if (external_contacts) {
-
- GList *node;
- for (node = external_contacts; node != NULL; node = g_list_next (node)) {
-
- AsDbusRecipient *recipient = (AsDbusRecipient*)node->data;
- if (!recipient)
- continue;
-
- g_free (recipient->display_name);
- g_free (recipient->email_address);
- g_free (recipient);
- }
-
- g_list_free (external_contacts);
- external_contacts = NULL;
- }
- }
-
- if (external_contacts) {
-
- gboolean found = FALSE;
- GList *node;
- for (node = external_contacts; node != NULL; node = g_list_next (node)) {
-
- AsDbusRecipient *recipient = (AsDbusRecipient*)node->data;
- if (!recipient)
- continue;
-
- GString *formatted_recipient = g_string_new (NULL);
- g_string_printf (formatted_recipient, "\"%s\" <%s>", recipient->display_name, recipient->email_address);
-
- /* FIXME: why we have to have list of lists? */
- GSList *formattedlist = g_slist_append(NULL, formatted_recipient->str);
- *resolved_addresses = g_slist_append (*resolved_addresses, formattedlist);
- /* FIXME: how important is an UID? */
- *contact_ids = g_slist_append (*contact_ids, g_strdup ("temp-uid"));
- found = TRUE;
-
- g_string_free (formatted_recipient, FALSE); /* character data segment is NOT freed */
- g_free (recipient->display_name);
- g_free (recipient->email_address);
- g_free (recipient);
- }
-
- g_list_free (external_contacts);
- external_contacts = NULL;
- return found;