diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-07-26 01:57:24 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-07-26 01:57:24 +0000 |
commit | d15db6745775aefb311a891d73e7f7f483c3c893 (patch) | |
tree | a026a0dab42a4ae9b1afc494be22f3d981362dbf | |
parent | 2a1742f72747eed8b3b4f25297049cb1e01c78ac (diff) |
fixed reply-to-all.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1099 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/compose.c | 38 |
2 files changed, 27 insertions, 17 deletions
@@ -1,3 +1,9 @@ +2006-07-26 + + * src/compose.c: compose_reply_set_entry(): use original address + strings instead of stripped ones. Fixed a bug that To: address + was duplicated in Cc: on reply-to-all. + 2006-07-25 * libsylph/prefs_common.[ch] diff --git a/src/compose.c b/src/compose.c index 7c0ab52c..9109f504 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1629,40 +1629,44 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo, if (!compose->replyto && to_ml && compose->ml_post) return; if (!to_all) return; + if (compose->replyto && msginfo->from) + cc_list = address_list_append_orig(cc_list, msginfo->from); + cc_list = address_list_append_orig(cc_list, msginfo->to); + cc_list = address_list_append_orig(cc_list, compose->cc); + + to_table = g_hash_table_new(g_str_hash, g_str_equal); if (compose->replyto) { - Xstrdup_a(replyto, compose->replyto, return); + replyto = g_strdup(compose->replyto); extract_address(replyto); - } - if (msginfo->from) { - Xstrdup_a(from, msginfo->from, return); + g_hash_table_insert(to_table, replyto, GINT_TO_POINTER(1)); + } else if (msginfo->from) { + from = g_strdup(msginfo->from); extract_address(from); + g_hash_table_insert(to_table, from, GINT_TO_POINTER(1)); } - - if (replyto && from) - cc_list = address_list_append(cc_list, from); - cc_list = address_list_append(cc_list, msginfo->to); - cc_list = address_list_append(cc_list, compose->cc); - - to_table = g_hash_table_new(g_str_hash, g_str_equal); - if (replyto) - g_hash_table_insert(to_table, replyto, GINT_TO_POINTER(1)); if (compose->account) - g_hash_table_insert(to_table, compose->account->address, + g_hash_table_insert(to_table, + g_strdup(compose->account->address), GINT_TO_POINTER(1)); - /* remove address on To: and that of current account */ + /* remove duplicate addresses */ for (cur = cc_list; cur != NULL; ) { gchar *addr = (gchar *)cur->data; GSList *next = cur->next; + gchar *addr_; - if (g_hash_table_lookup(to_table, addr) != NULL) { + addr_ = g_strdup(addr); + extract_address(addr_); + if (g_hash_table_lookup(to_table, addr_) != NULL) { cc_list = g_slist_remove(cc_list, addr); + g_free(addr_); g_free(addr); } else - g_hash_table_insert(to_table, addr, cur); + g_hash_table_insert(to_table, addr_, cur); cur = next; } + hash_free_strings(to_table); g_hash_table_destroy(to_table); if (cc_list) { |