2009-12-10 [pawel] 3.7.3cvs39
authorPaweł Pękala <c0rn@gazeta.pl>
Thu, 10 Dec 2009 16:42:33 +0000 (16:42 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Thu, 10 Dec 2009 16:42:33 +0000 (16:42 +0000)
* src/compose.c
Better fix for cvs28 regression

ChangeLog
PATCHSETS
configure.ac
src/compose.c

index bbfb3e875dbeed7b4b9157545067d75159983339..e17bd1ed3c28145815f2375fc2291255636ecf08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-10 [pawel]     3.7.3cvs39
+
+       * src/compose.c
+               Better fix for cvs28 regression
+
 2009-12-10 [iwkse]     3.7.3cvs38
 
        * src/compose.c
index 884635e4a90cf1962fd011e1b2c77f4bbfb0c191..5d206f534d2300cfc71d0e5e54b303d09496f695 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.533 -r 1.382.2.534 src/compose.c;  ) > 3.7.3cvs36.patchset
 ( cvs diff -u -r 1.382.2.534 -r 1.382.2.535 src/compose.c;  ) > 3.7.3cvs37.patchset
 ( cvs diff -u -r 1.382.2.535 -r 1.382.2.536 src/compose.c;  ) > 3.7.3cvs38.patchset
+( cvs diff -u -r 1.382.2.536 -r 1.382.2.537 src/compose.c;  ) > 3.7.3cvs39.patchset
index ca718d7eb2b5d912ba155a06b8e8694b3312c40a..59e74360b9f35d2b97ce3651f293eee11a28e1d7 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=38
+EXTRA_VERSION=39
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c0a60dcdb182c62f711b5ded074c88db4e3f2f92..be1d8f477824f6a507c44b7eb6737e66f146983e 100644 (file)
@@ -3049,6 +3049,7 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
        GSList *cur;
        gchar *from = NULL;
        gchar *replyto = NULL;
+       gchar *ac_email = NULL;
 
        gboolean reply_to_ml = FALSE;
        gboolean default_reply_to = FALSE;
@@ -3211,13 +3212,27 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
        cc_list = address_list_append_with_comments(cc_list, msginfo->to);
        cc_list = address_list_append_with_comments(cc_list, compose->cc);
 
+       ac_email = g_utf8_strdown(compose->account->address, -1);
+
        if (cc_list) {
-               for (cur = cc_list; cur != NULL; cur = cur->next)
-                       compose_entry_append(compose, (gchar *)cur->data,
-                                            COMPOSE_CC, PREF_NONE);
+               for (cur = cc_list; cur != NULL; cur = cur->next) {
+                       gchar *addr = g_utf8_strdown(cur->data, -1);
+                       extract_address(addr);
+               
+                       if (strcmp(ac_email, addr))
+                               compose_entry_append(compose, (gchar *)cur->data,
+                                                    COMPOSE_CC, PREF_NONE);
+                       else
+                               debug_print("Cc address same as compose account's, ignoring\n");
+
+                       g_free(addr);
+               }
+               
                slist_free_strings(cc_list);
                g_slist_free(cc_list);
        }
+       
+       g_free(ac_email);
 }
 
 #define SET_ENTRY(entry, str) \
@@ -4613,20 +4628,12 @@ compose_current_mail_account(void)
 static void compose_select_account(Compose *compose, PrefsAccount *account,
                                   gboolean init)
 {
-       gchar *from = NULL, *email, *header;
+       gchar *from = NULL, *header;
        ComposeHeaderEntry *header_entry;
 
        cm_return_if_fail(account != NULL);
 
-       email = g_utf8_strdown(compose->account->address, -1);
-       g_hash_table_remove(compose->email_hashtable, email);
-       g_free(email);
-
        compose->account = account;
-       g_hash_table_insert(compose->email_hashtable,
-                           g_utf8_strdown(account->address, -1),
-                           GUINT_TO_POINTER(1)); 
-
        if (account->name && *account->name) {
                gchar *buf;
                QUOTE_IF_REQUIRED_NORMAL(buf, account->name, return);
@@ -6535,12 +6542,14 @@ static void compose_add_header_entry(Compose *compose, const gchar *header,
 {
        ComposeHeaderEntry *last_header = compose->header_last;
        gchar *tmp = g_strdup(text), *email;
+       gboolean replyto_hdr = g_str_has_suffix(header, "-To:");
        
        extract_address(tmp);
        email = g_utf8_strdown(tmp, -1);
        
-       if (!(!strcmp(header, "To:") && !strcasecmp(compose->account->address, email))
-           && g_hash_table_lookup(compose->email_hashtable, email) != NULL) {
+       if (replyto_hdr == FALSE &&
+           g_hash_table_lookup(compose->email_hashtable, email) != NULL)
+       {
                debug_print("Ignoring duplicate address - %s %s, pref_type: %d\n",
                                header, text, (gint) pref_type);
                g_free(email);
@@ -6552,8 +6561,12 @@ static void compose_add_header_entry(Compose *compose, const gchar *header,
        gtk_entry_set_text(GTK_ENTRY(last_header->entry), text);
        last_header->type = pref_type;
 
-       g_hash_table_insert(compose->email_hashtable, email,
-                               GUINT_TO_POINTER(1));
+       if (replyto_hdr == FALSE)
+               g_hash_table_insert(compose->email_hashtable, email,
+                                   GUINT_TO_POINTER(1));
+       else
+               g_free(email);
+       
        g_free(tmp);
 }