content_type = tny_mime_part_get_content_type (TNY_MIME_PART (msg));
- if (content_type && !g_strcasecmp (content_type, "multipart/related")) {
+ if (content_type && !g_ascii_strcasecmp (content_type, "multipart/related")) {
parent = g_object_ref (msg);
- } else if (content_type && !g_strcasecmp (content_type, "multipart/mixed")) {
+ } else if (content_type && !g_ascii_strcasecmp (content_type, "multipart/mixed")) {
TnyList *parts = TNY_LIST (tny_simple_list_new ());
TnyIterator *iter;
TnyMimePart *part;
part = TNY_MIME_PART (tny_iterator_get_current (iter));
content_type = tny_mime_part_get_content_type (part);
- if (content_type && !g_strcasecmp (content_type, "multipart/related")) {
+ if (content_type && !g_ascii_strcasecmp (content_type, "multipart/related")) {
parent = part;
break;
} else {
modest_msg_edit_window_check_names (ModestMsgEditWindow *window, gboolean add_to_addressbook)
{
ModestMsgEditWindowPrivate *priv = NULL;
-
+ GSList *address_list = NULL;
+
g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window), FALSE);
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
return FALSE;
}
-/* if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->to_field), add_to_addressbook)) { */
- if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->to_field), NULL)) {
+ /* Check names */
+ g_object_ref (window);
+ if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->to_field), &address_list)) {
modest_recpt_editor_grab_focus (MODEST_RECPT_EDITOR (priv->to_field));
+ g_object_unref (window);
return FALSE;
}
-/* if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->cc_field), add_to_addressbook)) { */
- if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->cc_field), NULL)) {
+ if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->cc_field), &address_list)) {
modest_recpt_editor_grab_focus (MODEST_RECPT_EDITOR (priv->cc_field));
+ g_object_unref (window);
return FALSE;
}
-/* if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->bcc_field), add_to_addressbook)) { */
- if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->bcc_field), NULL)) {
+ if (!modest_address_book_check_names (MODEST_RECPT_EDITOR (priv->bcc_field), &address_list)) {
modest_recpt_editor_grab_focus (MODEST_RECPT_EDITOR (priv->bcc_field));
+ g_object_unref (window);
return FALSE;
}
+ /* Add contacts to address book */
+ if (address_list)
+ modest_address_book_add_address_list (address_list);
+
if (!modest_recpt_editor_has_focus (MODEST_RECPT_EDITOR (priv->cc_field)) &&
!modest_recpt_editor_has_focus (MODEST_RECPT_EDITOR (priv->bcc_field)))
modest_recpt_editor_grab_focus (MODEST_RECPT_EDITOR (priv->to_field));
+ g_object_unref (window);
return TRUE;