* src/maemo/modest-address-book.c:
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 15 Feb 2008 09:34:39 +0000 (09:34 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 15 Feb 2008 09:34:39 +0000 (09:34 +0000)
* We were storing the origin address after it was resolved in
  contacts. Fixes NB#80606.

pmo-trunk-r4179

src/maemo/modest-address-book.c

index 9b3541f..0f81b8a 100644 (file)
@@ -690,6 +690,7 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat
                gchar *start_ptr, *end_ptr;
                gint start_pos, end_pos;
                const gchar *invalid_char_position = NULL;
                gchar *start_ptr, *end_ptr;
                gint start_pos, end_pos;
                const gchar *invalid_char_position = NULL;
+               gboolean store_address = FALSE;
 
                start_pos = (*((gint*) current_start->data)) + offset_delta;
                end_pos = (*((gint*) current_end->data)) + offset_delta;
 
                start_pos = (*((gint*) current_start->data)) + offset_delta;
                end_pos = (*((gint*) current_end->data)) + offset_delta;
@@ -762,13 +763,14 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat
                                                                                     address_list, 
                                                                                     "");
                                g_slist_free (address_list);
                                                                                     address_list, 
                                                                                     "");
                                g_slist_free (address_list);
+                               store_address = TRUE;
                        }
                }
 
                /* so, it seems a valid address */
                /* note: adding it the to the addressbook if it did not exist yet,
                 * and adding it to the recent_list */
                        }
                }
 
                /* so, it seems a valid address */
                /* note: adding it the to the addressbook if it did not exist yet,
                 * and adding it to the recent_list */
-               if (result && update_addressbook)
+               if (result && update_addressbook && store_address)
                        add_to_address_book (address);
 
                g_free (address);
                        add_to_address_book (address);
 
                g_free (address);