fix problem with custom headers when trans_hdr is on
authorColin Leroy <colin@colino.net>
Mon, 16 Sep 2002 08:15:43 +0000 (08:15 +0000)
committerColin Leroy <colin@colino.net>
Mon, 16 Sep 2002 08:15:43 +0000 (08:15 +0000)
ChangeLog.claws
configure.in
src/compose.c

index 71ca8f0adce45211e68d80deb486ea5a04a291f8..6743431332d4f9ea9a2043bf024264bce1500229 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-15 [colin]     0.8.2claws52
+
+       * src/compose.c
+               Fix custom headers recognition when
+               prefs_common.trans_hdr is on
+
 2002-09-15 [colin]     0.8.2claws51
 
        * src/compose.c
index 0af294459c373560672084e3405306f0303f8888..5d797a9dca3bd097945b7042b3a5f7fdcf166036 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws51
+EXTRA_VERSION=claws52
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index f0a9f1ec4822d7de85455b4f34c38df6912d24e7..deb81ae99fbb0b8b19c8af87edc0ddefe5e7edce 100644 (file)
@@ -3882,7 +3882,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
        gchar *str;
        gchar *name;
        GSList *list;
-       gchar * std_headers[] = {"To", "Cc", "Bcc", "Newsgroups", "Reply-To", "Followup-To", NULL};
+       gchar * std_headers[] = {"To:", "Cc:", "Bcc:", "Newsgroups:", "Reply-To:", "Followup-To:", NULL};
 
        /* struct utsname utsbuf; */
 
@@ -4133,6 +4133,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
        for (list = compose->header_list; list; list = list->next) {
                ComposeHeaderEntry *headerentry;
                gchar * headerentryname;
+               gchar * trans_headername;
                gchar * headerentryvalue;
                gchar **string;
                gboolean standard_header = FALSE;
@@ -4140,23 +4141,24 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                headerentry = ((ComposeHeaderEntry *)list->data);
                headerentryname = g_strdup(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry)));
                headerentryvalue = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
-               if (strstr(headerentryname,":"))
-                       headerentryname = strtok(headerentryname,":");
                string = std_headers;
                while (*string != NULL) {
-                       if (!strcmp(*string,headerentryname))
+                       if (!strstr(headerentryname,":"))
+                               headerentryname = g_strconcat(headerentryname,":",NULL);
+                       trans_headername = (prefs_common.trans_hdr ? gettext(*string) : *string);
+                       if (!strcmp(trans_headername,headerentryname))
                                standard_header = TRUE;
                        string++;
                }
                if (!standard_header && !IS_IN_CUSTOM_HEADER(headerentryname))
-                       fprintf(fp,"%s: %s\n",headerentryname, headerentryvalue);
+                       fprintf(fp,"%s %s\n",headerentryname, headerentryvalue);
                                
                g_free(headerentryname);
        }
 
        /* separator between header and body */
        fputs("\n", fp);
-       
+
        return 0;
 }