aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-12 04:29:54 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-12 04:29:54 +0000
commit2e693597aa60fb25b8a22b2c5c2fc0db86bad7c9 (patch)
tree23e02929ff2c0abb084ed0362992f7563154e79d
parente8570d3dfd2589b07746d6e84a11743a5a8cf09d (diff)
optimized address auto-registration.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2467 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--src/compose.c19
2 files changed, 6 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 90597203..6e994d87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2010-02-12
+ * src/compose.c: compose_add_new_recipients_to_addressbook():
+ use addressbook_has_address().
+
+2010-02-12
+
* src/addressbook.c: lock addr_table since it can be accessed from
sub threads.
diff --git a/src/compose.c b/src/compose.c
index 36139969..15dca72f 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3327,9 +3327,6 @@ static void compose_add_new_recipients_to_addressbook(Compose *compose)
for (cur = to_list; cur != NULL; cur = cur->next) {
gchar *orig_addr = cur->data;
gchar *name, *addr;
- gchar *compaddr;
- gint count, i;
- gboolean found = FALSE;
name = procheader_get_fromname(orig_addr);
addr = g_strdup(orig_addr);
@@ -3339,21 +3336,7 @@ static void compose_add_new_recipients_to_addressbook(Compose *compose)
name = NULL;
}
- count = complete_address(addr);
- for (i = 1; i < count; i++) {
- compaddr = get_complete_address(i);
- if (compaddr) {
- g_print("compaddr: %s\n", compaddr);
- extract_address(compaddr);
- if (!g_ascii_strcasecmp(addr, compaddr)) {
- found = TRUE;
- break;
- }
- }
- }
- clear_completion_cache();
-
- if (found)
+ if (addressbook_has_address(addr))
debug_print("compose_add_new_recipients_to_addressbook: address <%s> already registered.\n", addr);
else
addressbook_add_contact_autoreg(name, addr, NULL);