gtk_widget_destroy (banner);
g_object_unref (G_OBJECT(banner));
}
- return TRUE;
+ if (last_length != 0) {
+ hildon_banner_show_information (NULL, NULL, _("mcen_nc_no_matching_contacts"));
+ return FALSE;
+ } else {
+ return TRUE;
+ }
}
current_start = start_indexes;
hildon_banner_show_information (NULL, NULL, _("mcen_ib_invalid_email"));
result = FALSE;
}
- }
+ } else {
+ GSList *tags, *node;
+ gboolean has_recipient = FALSE;
+
+ tags = gtk_text_iter_get_tags (&start_iter);
+ for (node = tags; node != NULL; node = g_slist_next (node)) {
+ GtkTextTag *tag = GTK_TEXT_TAG (node->data);
+ if (g_object_get_data (G_OBJECT (tag), "recipient-tag-id") != NULL) {
+ has_recipient = TRUE;
+ break;
+ }
+ }
+ g_slist_free (tags);
+ if (!has_recipient) {
+ GSList * address_list = NULL;
+
+ address_list = g_slist_prepend (address_list, address);
+ modest_recpt_editor_replace_with_resolved_recipient (recpt_editor,
+ &start_iter, &end_iter,
+ address_list,
+ "");
+ g_slist_free (address_list);
+ }
+ }
/* so, it seems a valid address */
/* note: adding it the to the addressbook if it did not exist yet,