Fixes NB#111054, do not send emails to unmatched contacts
authorSergio Villar Senin <svillar@igalia.com>
Wed, 15 Apr 2009 13:52:54 +0000 (13:52 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 15 Apr 2009 13:52:54 +0000 (13:52 +0000)
pmo-trunk-r8821

src/hildon2/modest-address-book.c

index b160324..2302ed4 100644 (file)
@@ -909,12 +909,20 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat
                                        new_length = g_utf8_strlen (recipients, -1);
                                        offset_delta = offset_delta + new_length - last_length;
                                        last_length = new_length;
-                               } else if (canceled) {
-                                       /* We have to remove the recipient if not resolved */
-                                       modest_recpt_editor_replace_with_resolved_recipient (recpt_editor,
-                                                                                            &start_iter, &end_iter,
-                                                                                            NULL,
-                                                                                            NULL);
+                               } else {
+                                       if (canceled) {
+                                               /* We have to remove the recipient if not resolved */
+                                               modest_recpt_editor_replace_with_resolved_recipient (recpt_editor,
+                                                                                                    &start_iter, 
+                                                                                                    &end_iter,
+                                                                                                    NULL,
+                                                                                                    NULL);
+                                       } else {
+                                               /* There is no contact with that name so it's not
+                                                  valid. Don't show any error because it'll be done
+                                                  later */
+                                               result = FALSE;
+                                       }
                                }
                        } else {
                                /* this address is not valid, select it and return control to user showing banner */