* after removing the last attachment, move focus to subject field
[modest] / src / maemo / modest-address-book.c
index 85369e6..294541d 100644 (file)
@@ -692,7 +692,7 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat
                start_ptr = g_utf8_offset_to_pointer (recipients, start_pos);
                end_ptr = g_utf8_offset_to_pointer (recipients, end_pos);
 
-               address = g_strndup (start_ptr, end_ptr - start_ptr);
+               address = g_strstrip (g_strndup (start_ptr, end_ptr - start_ptr));
                gtk_text_buffer_get_iter_at_offset (buffer, &start_iter, start_pos);
                gtk_text_buffer_get_iter_at_offset (buffer, &end_iter, end_pos);
                gtk_text_buffer_select_range (buffer, &start_iter, &end_iter);
@@ -879,17 +879,21 @@ resolve_address (const gchar *address, GSList **resolved_addresses, gchar **cont
        
        /* get the resolved contacts (can be no contact) */
        if (resolved_contacts) {
+               gboolean found;
                EContact *contact = (EContact *) resolved_contacts->data;
 
                *resolved_addresses = get_recipients_for_given_contact (contact);
                if (*resolved_addresses) {
                        *contact_id = g_strdup (e_contact_get_const (contact, E_CONTACT_UID));
+                       found = TRUE;
+               } else {
+                       found = FALSE;
                }
 
                g_list_foreach (resolved_contacts, (GFunc)unref_gobject, NULL);
                g_list_free (resolved_contacts);
 
-               return TRUE;
+               return found;
        } else {
                /* cancelled dialog to select more than one contact or
                 * selected no contact */