2009-12-02 [pawel] 3.7.3cvs28
authorPaweł Pękala <c0rn@gazeta.pl>
Wed, 2 Dec 2009 17:05:00 +0000 (17:05 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Wed, 2 Dec 2009 17:05:00 +0000 (17:05 +0000)
* src/compose.c
Fix Bug 2055 "duplicate mailing list reply if
List-Post + Reply-To present"
- Ignore Reply-To if answering to ML
- Improve parsing of List-Post header

ChangeLog
PATCHSETS
configure.ac
src/compose.c

index 911252e8d1091d0884997bc53bf9baac0f2fb283..c01da7b6f640b9aac610e59de5ecf5ad47e1f8b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-02 [pawel]     3.7.3cvs28
+
+       * src/compose.c
+               Fix Bug 2055 "duplicate mailing list reply if
+               List-Post + Reply-To present"
+               - Ignore Reply-To if answering to ML
+               - Improve parsing of List-Post header
+
 2009-12-02 [pawel]     3.7.3cvs27
 
        * src/compose.c
 2009-12-02 [pawel]     3.7.3cvs27
 
        * src/compose.c
index d4002ff3754a4af2892dcf4c62567c42ccd79526..b995181d5fb2e5603f2a4d853c632b1caf085768 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.415 -r 1.395.2.416 src/summaryview.c;  cvs diff -u -r 1.68.2.52 -r 1.68.2.53 src/summaryview.h;  ) > 3.7.3cvs25.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 manual/intro.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/es/intro.xml;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/fr/intro.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/it/intro.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/pl/intro.xml;  ) > 3.7.3cvs26.patchset
 ( cvs diff -u -r 1.382.2.526 -r 1.382.2.527 src/compose.c;  cvs diff -u -r 1.50.2.56 -r 1.50.2.57 src/compose.h;  ) > 3.7.3cvs27.patchset
 ( cvs diff -u -r 1.395.2.415 -r 1.395.2.416 src/summaryview.c;  cvs diff -u -r 1.68.2.52 -r 1.68.2.53 src/summaryview.h;  ) > 3.7.3cvs25.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 manual/intro.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/es/intro.xml;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/fr/intro.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/it/intro.xml;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/pl/intro.xml;  ) > 3.7.3cvs26.patchset
 ( cvs diff -u -r 1.382.2.526 -r 1.382.2.527 src/compose.c;  cvs diff -u -r 1.50.2.56 -r 1.50.2.57 src/compose.h;  ) > 3.7.3cvs27.patchset
+( cvs diff -u -r 1.382.2.527 -r 1.382.2.528 src/compose.c;  ) > 3.7.3cvs28.patchset
index 578211898db731871a3feba9f86f15811b96ecc4..d6eb925f8e57113e592c27b2059579f39d79ca51 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=27
+EXTRA_VERSION=28
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a49870c3029dfe972f628e63c8962b2f13e075c8..bffd79cb82ece814cccb2643cc37ec39db199732 100644 (file)
@@ -2743,12 +2743,15 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
                hentry[H_FOLLOWUP_TO].body = NULL;
        }
        if (hentry[H_LIST_POST].body != NULL) {
                hentry[H_FOLLOWUP_TO].body = NULL;
        }
        if (hentry[H_LIST_POST].body != NULL) {
-               gchar *to = NULL;
+               gchar *to = NULL, *start = NULL;
 
                extract_address(hentry[H_LIST_POST].body);
                if (hentry[H_LIST_POST].body[0] != '\0') {
 
                extract_address(hentry[H_LIST_POST].body);
                if (hentry[H_LIST_POST].body[0] != '\0') {
-                       scan_mailto_url(hentry[H_LIST_POST].body,
+                       start = strstr(hentry[H_LIST_POST].body, "mailto:");
+                       
+                       scan_mailto_url(start ? start : hentry[H_LIST_POST].body,
                                        NULL, &to, NULL, NULL, NULL, NULL, NULL);
                                        NULL, &to, NULL, NULL, NULL, NULL, NULL);
+
                        if (to) {
                                g_free(compose->ml_post);
                                compose->ml_post = to;
                        if (to) {
                                g_free(compose->ml_post);
                                compose->ml_post = to;
@@ -3015,22 +3018,6 @@ static gboolean is_subscription(const gchar *ml_post, const gchar *from)
        return result;
 }
 
        return result;
 }
 
-static gboolean same_address(const gchar *addr1, const gchar *addr2)
-{
-       gchar *my_addr1, *my_addr2;
-       
-       if (!addr1 || !addr2)
-               return FALSE;
-
-       Xstrdup_a(my_addr1, addr1, return FALSE);
-       Xstrdup_a(my_addr2, addr2, return FALSE);
-       
-       extract_address(my_addr1);
-       extract_address(my_addr2);
-       
-       return !strcasecmp(my_addr1, my_addr2);
-}
-
 static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                                    gboolean to_all, gboolean to_ml,
                                    gboolean to_sender,
 static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                                    gboolean to_all, gboolean to_ml,
                                    gboolean to_sender,
@@ -3040,7 +3027,6 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
        GSList *cur;
        gchar *from = NULL;
        gchar *replyto = NULL;
        GSList *cur;
        gchar *from = NULL;
        gchar *replyto = NULL;
-       GHashTable *to_table;
 
        gboolean reply_to_ml = FALSE;
        gboolean default_reply_to = FALSE;
 
        gboolean reply_to_ml = FALSE;
        gboolean default_reply_to = FALSE;
@@ -3077,8 +3063,7 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                                compose_entry_append(compose,
                                           compose->ml_post,
                                           COMPOSE_TO, PREF_ML);
                                compose_entry_append(compose,
                                           compose->ml_post,
                                           COMPOSE_TO, PREF_ML);
-                               if (compose->replyto
-                               &&  !same_address(compose->ml_post, compose->replyto))
+                               if (to_all && compose->replyto)
                                        compose_entry_append(compose,
                                                compose->replyto,
                                                COMPOSE_CC, PREF_ML);
                                        compose_entry_append(compose,
                                                compose->replyto,
                                                COMPOSE_CC, PREF_ML);
@@ -3204,31 +3189,6 @@ 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);
 
        cc_list = address_list_append_with_comments(cc_list, msginfo->to);
        cc_list = address_list_append_with_comments(cc_list, compose->cc);
 
-       to_table = g_hash_table_new(g_str_hash, g_str_equal);
-       if (replyto)
-               g_hash_table_insert(to_table, g_utf8_strdown(replyto, -1), GINT_TO_POINTER(1));
-       if (compose->account) {
-               g_hash_table_insert(to_table, g_utf8_strdown(compose->account->address, -1),
-                                   GINT_TO_POINTER(1));
-       }
-       /* remove address on To: and that of current account */
-       for (cur = cc_list; cur != NULL; ) {
-               GSList *next = cur->next;
-               gchar *addr;
-
-               addr = g_utf8_strdown(cur->data, -1);
-               extract_address(addr);
-
-               if (GPOINTER_TO_INT(g_hash_table_lookup(to_table, addr)) == 1)
-                       cc_list = g_slist_remove(cc_list, cur->data);
-               else
-                       g_hash_table_insert(to_table, addr, GINT_TO_POINTER(1));
-
-               cur = next;
-       }
-       hash_free_strings(to_table);
-       g_hash_table_destroy(to_table);
-
        if (cc_list) {
                for (cur = cc_list; cur != NULL; cur = cur->next)
                        compose_entry_append(compose, (gchar *)cur->data,
        if (cc_list) {
                for (cur = cc_list; cur != NULL; cur = cur->next)
                        compose_entry_append(compose, (gchar *)cur->data,
@@ -3236,7 +3196,6 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                slist_free_strings(cc_list);
                g_slist_free(cc_list);
        }
                slist_free_strings(cc_list);
                g_slist_free(cc_list);
        }
-
 }
 
 #define SET_ENTRY(entry, str) \
 }
 
 #define SET_ENTRY(entry, str) \