2010-02-08 [pawel] 3.7.5cvs8
authorPaweł Pękala <c0rn@gazeta.pl>
Mon, 8 Feb 2010 17:54:10 +0000 (17:54 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Mon, 8 Feb 2010 17:54:10 +0000 (17:54 +0000)
* src/compose.c
* src/compose.h
* src/common/utils.c
* src/common/utils.h
* src/gtk/authors.h
Fix Bug 2058 "use in-reply-to info passed in mailto: links"
Patch by Laurent Bigonville with slight modifications

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c
src/common/utils.h
src/compose.c
src/compose.h
src/gtk/authors.h

index fb4d3a6..601f3ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-08 [pawel]     3.7.5cvs8
+
+       * src/compose.c
+       * src/compose.h
+       * src/common/utils.c
+       * src/common/utils.h
+       * src/gtk/authors.h
+               Fix Bug 2058 "use in-reply-to info passed in mailto: links"
+               Patch by Laurent Bigonville with slight modifications
+
 2010-02-03 [pawel]     3.7.5cvs7
 
        * m4/.cvsignore
index 25ef94a..2785b6b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.28.2.42 -r 1.28.2.43 src/addrindex.c;  cvs diff -u -r 1.8.2.36 -r 1.8.2.37 src/editldap.c;  cvs diff -u -r 1.2.2.19 -r 1.2.2.20 src/ldapctrl.c;  cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/ldapctrl.h;  cvs diff -u -r 1.3.2.33 -r 1.3.2.34 src/ldapquery.c;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/ldapupdate.c;  ) > 3.7.5cvs5.patchset
 ( cvs diff -u -r 1.14.2.69 -r 1.14.2.70 src/plugins/trayicon/trayicon.c;  ) > 3.7.5cvs6.patchset
 ( cvs diff -u -r 1.2.4.1 -r 1.2.4.2 m4/.cvsignore;  ) > 3.7.5cvs7.patchset
+( cvs diff -u -r 1.382.2.541 -r 1.382.2.542 src/compose.c;  cvs diff -u -r 1.50.2.58 -r 1.50.2.59 src/compose.h;  cvs diff -u -r 1.36.2.182 -r 1.36.2.183 src/common/utils.c;  cvs diff -u -r 1.20.2.73 -r 1.20.2.74 src/common/utils.h;  cvs diff -u -r 1.1.2.64 -r 1.1.2.65 src/gtk/authors.h;  ) > 3.7.5cvs8.patchset
index c1da311..a8d0be3 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=7
+EXTRA_VERSION=8
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index f4ec081..2dccd11 100644 (file)
@@ -1551,7 +1551,7 @@ static gchar *decode_uri_gdup(const gchar *encoded_uri)
 }
 
 gint scan_mailto_url(const gchar *mailto, gchar **from, gchar **to, gchar **cc, gchar **bcc,
-                    gchar **subject, gchar **body, gchar ***attach)
+                    gchar **subject, gchar **body, gchar ***attach, gchar **inreplyto)
 {
        gchar *tmp_mailto;
        gchar *p;
@@ -1659,6 +1659,9 @@ gint scan_mailto_url(const gchar *mailto, gchar **from, gchar **to, gchar **cc,
                                my_att[num_attach-1] = tmp;
                                my_att[num_attach] = NULL;
                        }
+               } else if (inreplyto && !*inreplyto &&
+                          !g_ascii_strcasecmp(field, "in-reply-to")) {
+                       *inreplyto = decode_uri_gdup(value);
                }
        }
 
index 92b4b57..2bdc1fc 100644 (file)
@@ -405,7 +405,8 @@ gint scan_mailto_url                        (const gchar    *mailto,
                                         gchar         **bcc,
                                         gchar         **subject,
                                         gchar         **body,
-                                        gchar         ***attach);
+                                        gchar         ***attach,
+                                        gchar         **inreplyto);
 
 /* return static strings */
 const gchar *get_home_dir              (void);
index 429e77c..734ad44 100644 (file)
@@ -949,7 +949,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
 
        /* check if mailto defines a from */
        if (mailto && *mailto != '\0') {
-               scan_mailto_url(mailto, &mailto_from, NULL, NULL, NULL, NULL, NULL, NULL);
+               scan_mailto_url(mailto, &mailto_from, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
                /* mailto defines a from, check if we can get account prefs from it,
                   if not, the account prefs will be guessed using other ways, but we'll keep
                   the from anyway */
@@ -2484,6 +2484,9 @@ void compose_entry_append(Compose *compose, const gchar *address,
        case COMPOSE_FOLLOWUPTO:
                header = N_( "Followup-To:");
                break;
+       case COMPOSE_INREPLYTO:
+               header = N_( "In-Reply-To:");
+               break;
        case COMPOSE_TO:
        default:
                header = N_("To:");
@@ -2616,10 +2619,11 @@ static MailField compose_entries_set(Compose *compose, const gchar *mailto, Comp
        gchar *temp = NULL;
        gsize  len = 0;
        gchar **attach = NULL;
+       gchar *inreplyto = NULL;
        MailField mfield = NO_FIELD_PRESENT;
 
        /* get mailto parts but skip from */
-       scan_mailto_url(mailto, NULL, &to, &cc, &bcc, &subject, &body, &attach);
+       scan_mailto_url(mailto, NULL, &to, &cc, &bcc, &subject, &body, &attach, &inreplyto);
 
        if (to) {
                compose_entry_append(compose, to, to_type, PREF_MAILTO);
@@ -2693,12 +2697,16 @@ static MailField compose_entries_set(Compose *compose, const gchar *mailto, Comp
                        g_free(warn_files);
                }
        }
+       if (inreplyto)
+               compose_entry_append(compose, inreplyto, COMPOSE_INREPLYTO, PREF_MAILTO);
+
        g_free(to);
        g_free(cc);
        g_free(bcc);
        g_free(subject);
        g_free(body);
        g_strfreev(attach);
+       g_free(inreplyto);
        
        return mfield;
 }
@@ -2787,7 +2795,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
                        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, NULL);
 
                        if (to) {
                                g_free(compose->ml_post);
@@ -3274,6 +3282,7 @@ static void compose_reedit_set_entry(Compose *compose, MsgInfo *msginfo)
        SET_ADDRESS(COMPOSE_REPLYTO, compose->replyto);
        SET_ADDRESS(COMPOSE_NEWSGROUPS, compose->newsgroups);
        SET_ADDRESS(COMPOSE_FOLLOWUPTO, compose->followup_to);
+       SET_ADDRESS(COMPOSE_INREPLYTO, compose->inreplyto);
 
        compose_update_priority_menu_item(compose);
        compose_update_privacy_system_menu_item(compose, FALSE);
@@ -6572,7 +6581,11 @@ static void compose_add_header_entry(Compose *compose, const gchar *header,
                return;
        }
        
-       combobox_select_by_text(GTK_COMBO_BOX(last_header->combo), header);
+       if (!strcmp(header, prefs_common_translated_header_name("In-Reply-To:")))
+               gtk_entry_set_text(GTK_ENTRY(
+                       gtk_bin_get_child(GTK_BIN(last_header->combo))), header);
+       else
+               combobox_select_by_text(GTK_COMBO_BOX(last_header->combo), header);
        gtk_entry_set_text(GTK_ENTRY(last_header->entry), text);
        last_header->type = pref_type;
 
index affef99..da0e4bf 100644 (file)
@@ -52,7 +52,8 @@ typedef enum
        COMPOSE_BCC,
        COMPOSE_REPLYTO,
        COMPOSE_NEWSGROUPS,
-       COMPOSE_FOLLOWUPTO
+       COMPOSE_FOLLOWUPTO,
+       COMPOSE_INREPLYTO
 } ComposeEntryType;
 
 typedef enum
index 4049de3..7b91a99 100644 (file)
@@ -89,6 +89,7 @@ static char *CONTRIBS_LIST[] = {
 "M. Benkmann",
 "Wilbert Berendsen",
 "Didier Barvaux",
+"Laurent Bigonville",
 "Jean-Luc Biord",
 "Pavlo Bohmat",
 "Eugene Brevdo",