From 7e0006d1eadd277c5998f9606abec507b316f44f Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Thu, 17 Apr 2003 22:01:58 +0000 Subject: [PATCH] sync with 0.8.11cvs28 --- ChangeLog | 6 ++++++ ChangeLog.claws | 5 +++++ ChangeLog.jp | 7 +++++++ configure.ac | 2 +- src/codeconv.c | 13 ++++++++++++- src/codeconv.h | 3 ++- src/compose.c | 45 +++++++++++++++++++++++++++------------------ src/messageview.c | 2 +- 8 files changed, 61 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c7d1f6a7..ebfd2b4cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-04-17 + + * src/codeconv.[ch]: conv_encode_header(): don't include '(' and ')' + in encoded strings if addr_field is TRUE. + * src/compose.c: compose_convert_header(): added a flag 'addr_field'. + 2003-04-16 * src/prefs_actions.[ch]: separated action execution routine into diff --git a/ChangeLog.claws b/ChangeLog.claws index dd42476ca..a9bcabac0 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2003-04-17 [paul] 0.8.11claws99 + + * sync with 0.8.11cvs28 + see ChangeLog 2003-04-17 + 2003-04-17 [christoph] 0.8.11claws98 * ac/spamassassin.m4 diff --git a/ChangeLog.jp b/ChangeLog.jp index e0e5e2366..d23dc5988 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,10 @@ +2003-04-17 + + * src/codeconv.[ch]: conv_encode_header(): addr_field ¤¬ TRUE ¤Î + ¾ì¹ç¤Ï¥¨¥ó¥³¡¼¥Éʸ»úÎó¤Ë '(' ¤È ')' ¤ò´Þ¤á¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£ + * src/compose.c: compose_convert_header(): ¥Õ¥é¥° 'addr_field' ¤ò + Äɲᣠ+ 2003-04-16 * src/prefs_actions.[ch]: ¥¢¥¯¥·¥ç¥ó¼Â¹Ô¥ë¡¼¥Á¥ó¤ò action.[ch] ¤Ë diff --git a/configure.ac b/configure.ac index 521a31856..fbfd7a612 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=11 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws98 +EXTRA_VERSION=claws99 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/codeconv.c b/src/codeconv.c index 19b842811..52db04e07 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -1438,7 +1438,7 @@ void conv_unmime_header(gchar *outbuf, gint outlen, const gchar *str, } void conv_encode_header(gchar *dest, gint len, const gchar *src, - gint header_len) + gint header_len, gboolean addr_field) { const gchar *cur_encoding; const gchar *out_encoding; @@ -1494,6 +1494,13 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src, continue; } + /* don't include parentheses in encoded strings */ + if (addr_field && (*srcp == '(' || *srcp == ')')) { + LBREAK_IF_REQUIRED(left < 2, FALSE); + *destp++ = *srcp++; + left--; + } + while (1) { gint mb_len = 0; gint cur_len = 0; @@ -1509,6 +1516,10 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src, while (*p != '\0') { if (isspace(*p) && !is_next_nonascii(p + 1)) break; + /* don't include parentheses in encoded + strings */ + if (addr_field && (*p == '(' || *p == ')')) + break; if (MB_CUR_MAX > 1) { mb_len = mblen(p, MB_CUR_MAX); diff --git a/src/codeconv.h b/src/codeconv.h index 7dfb14f4e..19c24248f 100644 --- a/src/codeconv.h +++ b/src/codeconv.h @@ -222,7 +222,8 @@ void conv_unmime_header (gchar *outbuf, void conv_encode_header (gchar *dest, gint len, const gchar *src, - gint header_len); + gint header_len, + gboolean addr_field); #endif /* __CODECONV_H__ */ diff --git a/src/compose.c b/src/compose.c index 79931bed8..d303b75ae 100644 --- a/src/compose.c +++ b/src/compose.c @@ -247,7 +247,8 @@ static gint compose_write_headers (Compose *compose, static void compose_convert_header (gchar *dest, gint len, gchar *src, - gint header_len); + gint header_len, + gboolean addr_field); static void compose_generate_msgid (Compose *compose, gchar *buf, gint len); @@ -3131,7 +3132,7 @@ static gint compose_redirect_write_headers_from_headerlist(Compose *compose, if (str[0] != '\0') { compose_convert_header (buf, sizeof(buf), str, - strlen("Resent-To") + 2); + strlen("Resent-To") + 2, TRUE); if (first_address) { fprintf(fp, "Resent-To: "); first_address = FALSE; @@ -3167,7 +3168,7 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp) if (compose->account->name && *compose->account->name) { compose_convert_header (buf, sizeof(buf), compose->account->name, - strlen("From: ")); + strlen("From: "), TRUE); fprintf(fp, "Resent-From: %s <%s>\n", buf, compose->account->address); } else @@ -3180,7 +3181,7 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp) g_strstrip(str); if (*str != '\0') { compose_convert_header(buf, sizeof(buf), str, - strlen("Subject: ")); + strlen("Subject: "), FALSE); fprintf(fp, "Subject: %s\n", buf); } } @@ -3250,7 +3251,8 @@ static gint compose_redirect_write_to_file(Compose *compose, const gchar *file) compose_convert_header (buf, sizeof(buf), compose->account->name, - strlen("From: ")); + strlen("From: "), + FALSE); fprintf(fdest, "%s <%s>", buf, compose->account->address); @@ -3889,7 +3891,7 @@ static void compose_write_attach(Compose *compose, FILE *fp) fprintf(fp, "Content-Disposition: inline\n"); } else { compose_convert_header(filename, sizeof(filename), - ainfo->name, 12); + ainfo->name, 12, FALSE); fprintf(fp, "Content-Type: %s;\n" " name=\"%s\"\n", ainfo->content_type, filename); @@ -3962,7 +3964,8 @@ static void compose_write_attach(Compose *compose, FILE *fp) compose->to_list = address_list_append \ (compose->to_list, str); \ compose_convert_header \ - (buf, sizeof(buf), str, strlen(header) + 2); \ + (buf, sizeof(buf), str, strlen(header) + 2, \ + TRUE); \ fprintf(fp, "%s: %s\n", header, buf); \ } \ } \ @@ -4004,7 +4007,7 @@ static gint compose_write_headers_from_headerlist(Compose *compose, if (str[0] != '\0') { compose_convert_header (buf, sizeof(buf), str, - strlen(header) + 2); + strlen(header) + 2, TRUE); if (first_address) { fprintf(fp, "%s: ", header); first_address = FALSE; @@ -4066,7 +4069,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, if (compose->account->name && *compose->account->name) { compose_convert_header (buf, sizeof(buf), compose->account->name, - strlen("From: ")); + strlen("From: "), TRUE); QUOTE_IF_REQUIRED(name, buf); fprintf(fp, "From: %s <%s>\n", name, compose->account->address); @@ -4097,7 +4100,8 @@ static gint compose_write_headers(Compose *compose, FILE *fp, newsgroup_list_append (compose->newsgroup_list, str); compose_convert_header(buf, sizeof(buf), str, - strlen("Newsgroups: ")); + strlen("Newsgroups: "), + TRUE); fprintf(fp, "Newsgroups: %s\n", buf); } } @@ -4127,7 +4131,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, g_strstrip(str); if (*str != '\0') { compose_convert_header(buf, sizeof(buf), str, - strlen("Subject: ")); + strlen("Subject: "), FALSE); fprintf(fp, "Subject: %s\n", buf); } } @@ -4158,7 +4162,8 @@ static gint compose_write_headers(Compose *compose, FILE *fp, remove_space(str); if (*str != '\0') { compose_convert_header(buf, sizeof(buf), str, - strlen("Followup-To: ")); + strlen("Followup-To: "), + TRUE); fprintf(fp, "Followup-To: %s\n", buf); } } @@ -4174,7 +4179,8 @@ static gint compose_write_headers(Compose *compose, FILE *fp, g_strstrip(str); if (*str != '\0') { compose_convert_header(buf, sizeof(buf), str, - strlen("Reply-To: ")); + strlen("Reply-To: "), + TRUE); fprintf(fp, "Reply-To: %s\n", buf); } } @@ -4185,7 +4191,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, !IS_IN_CUSTOM_HEADER("Organization")) { compose_convert_header(buf, sizeof(buf), compose->account->organization, - strlen("Organization: ")); + strlen("Organization: "), FALSE); fprintf(fp, "Organization: %s\n", buf); } @@ -4229,7 +4235,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, compose_convert_header (buf, sizeof(buf), chdr->value ? chdr->value : "", - strlen(chdr->name) + 2); + strlen(chdr->name) + 2, FALSE); fprintf(fp, "%s: %s\n", chdr->name, buf); } } @@ -4276,7 +4282,10 @@ static gint compose_write_headers(Compose *compose, FILE *fp, if (compose->return_receipt) { if (compose->account->name && *compose->account->name) { - compose_convert_header(buf, sizeof(buf), compose->account->name, strlen("Disposition-Notification-To: ")); + compose_convert_header(buf, sizeof(buf), + compose->account->name, + strlen("Disposition-Notification-To: "), + TRUE); fprintf(fp, "Disposition-Notification-To: %s <%s>\n", buf, compose->account->address); } else fprintf(fp, "Disposition-Notification-To: %s\n", compose->account->address); @@ -4331,7 +4340,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp, #undef IS_IN_CUSTOM_HEADER static void compose_convert_header(gchar *dest, gint len, gchar *src, - gint header_len) + gint header_len, gboolean addr_field) { g_return_if_fail(src != NULL); g_return_if_fail(dest != NULL); @@ -4340,7 +4349,7 @@ static void compose_convert_header(gchar *dest, gint len, gchar *src, g_strchomp(src); - conv_encode_header(dest, len, src, header_len); + conv_encode_header(dest, len, src, header_len, addr_field); } static void compose_generate_msgid(Compose *compose, gchar *buf, gint len) diff --git a/src/messageview.c b/src/messageview.c index de2ce30af..710b8e10e 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -431,7 +431,7 @@ static void notification_convert_header(gchar *dest, gint len, dest[len - 1] = '\0'; return; } else - conv_encode_header(dest, len, src, header_len); + conv_encode_header(dest, len, src, header_len, FALSE); } static gint disposition_notification_queue(PrefsAccount * account, -- 2.25.1