From 279c1da346d300d9aa332ba16b263fd35ba134e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Thu, 29 Nov 2001 23:55:49 +0000 Subject: [PATCH] bounce / processing --- ChangeLog.claws | 10 +++++ configure.in | 2 +- src/compose.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++ src/folderview.c | 2 + 4 files changed, 116 insertions(+), 1 deletion(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index a68b3df58..2b187c81e 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,13 @@ +2001-11-30 [hoa] 0.6.5claws45 + + * src/compose.c + slightly change bounce function to add + information about the user that bounced the mail + in the From header line. + + * src/folderview.c + permit the use of processing in outbox folder. + 2001-11-29 [paul] 0.6.5claws44 * src/mainwindow.[ch] diff --git a/configure.in b/configure.in index 6f9d8eb66..c6273a33b 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=6 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws44 +EXTRA_VERSION=claws45 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl diff --git a/src/compose.c b/src/compose.c index c70858b6b..523274b7b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2405,8 +2405,93 @@ static void compose_wrap_line_all(Compose *compose) gtk_stext_thaw(text); } +<<<<<<< compose.c +#if 0 +static void compose_wrap_line_all(Compose *compose) +{ + GtkText *text = GTK_STEXT(compose->text); + guint text_len; + guint line_pos = 0, cur_pos = 0; + gint line_len = 0, cur_len = 0; + gint ch_len; + gchar cbuf[MB_LEN_MAX]; + + gtk_stext_freeze(text); + + text_len = gtk_stext_get_length(text); + + for (; cur_pos < text_len; cur_pos++) { + if (text->use_wchar) + ch_len = wctomb + (cbuf, (wchar_t)GTK_STEXT_INDEX(text, cur_pos)); + else { + cbuf[0] = GTK_STEXT_INDEX(text, cur_pos); + ch_len = 1; + } + + if (ch_len == 1 && *cbuf == '\n') { + line_pos = cur_pos + 1; + line_len = cur_len = 0; + continue; + } + + if (ch_len < 0) { + cbuf[0] = '\0'; + ch_len = 1; + } +======= +>>>>>>> 1.110 + +<<<<<<< compose.c + if (ch_len == 1 && isspace(*cbuf)) { + line_pos = cur_pos + 1; + line_len = cur_len + ch_len; + } +======= #undef GET_CHAR +>>>>>>> 1.110 + + if (cur_len + ch_len > prefs_common.linewrap_len && + line_len > 0) { + gint tlen; + + if (text->use_wchar) + tlen = wctomb(cbuf, (wchar_t)GTK_STEXT_INDEX(text, line_pos - 1)); + else { + cbuf[0] = GTK_STEXT_INDEX(text, line_pos - 1); + tlen = 1; + } + if (tlen == 1 && isspace(*cbuf)) { + gtk_stext_set_point(text, line_pos); + gtk_stext_backward_delete(text, 1); + text_len--; + cur_pos--; + line_pos--; + cur_len--; + line_len--; + } + + gtk_stext_set_point(text, line_pos); + gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1); + text_len++; + cur_pos++; + line_pos++; + cur_len = cur_len - line_len + ch_len; + line_len = 0; + continue; + } + + if (ch_len > 1) { + line_pos = cur_pos + 1; + line_len = cur_len + ch_len; + } + cur_len += ch_len; + } + + gtk_stext_thaw(text); +} +#endif static void compose_set_title(Compose *compose) { @@ -2753,8 +2838,26 @@ static gint compose_bounce_write_to_file(Compose *compose, const gchar *file) || (g_strncasecmp(buf, "Delivered-To:", strlen("Delivered-To:")) == 0)) continue; + if (fputs(buf, fdest) == -1) goto error; + + if (g_strncasecmp(buf, "From:", strlen("From:")) == 0) { + fputs(" (by way of ", fdest); + if (compose->account->name + && *compose->account->name) { + compose_convert_header + (buf, sizeof(buf), + compose->account->name, + strlen("From: ")); + fprintf(fdest, "%s <%s>", + buf, compose->account->address); + } else + fprintf(fdest, "%s", + compose->account->address); + fputs(")", fdest); + } + if (fputs("\n", fdest) == -1) goto error; } diff --git a/src/folderview.c b/src/folderview.c index afd706b69..9398e7ac5 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -1275,6 +1275,8 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event, folder_property = folder_scoring = folder_processing = TRUE; else if (item->stype == F_TRASH) folder_processing = TRUE; + else if (item->stype == F_OUTBOX) + folder_processing = TRUE; } else if (FOLDER_TYPE(folder) == F_NEWS) { if (item->parent != NULL) delete_folder = folder_scoring = folder_processing = TRUE; -- 2.25.1