|
sylpheed-jp:2064
From: "Good**, Hironori(Shohta) NAGAKUBO" <shohta@xxxxxxxxxx> Good**, 長久保@福島いわき です。 On Fri, 15 Nov 2002 18:47:32 +0900 Subject: [sylpheed-jp:02063] Sylpheed 0.8.6 released Message-ID: <20021115184732.7dd13f0d.hiro-y@xxxxxxxxxx> Hiroyuki Yamamoto <hiro-y@xxxxxxxxxx> さん wrote: > 山本です。 > > Sylpheed 0.8.6 をリリースしました。 ありがとうございます。 早速アップいたしました。 今回のアップで、私は今まで愛用していた、HIROSHIMA Naoki <naokih@xxxxxxxxxx>さんの「外部エディタでヘッダも編集できるようにするパッチ」が使用不可の状態になってしまいました。 今年の初めから愛用しておりますので、何とか使い続けたいと思っております。 以下のようなパッチです。 ―――――――――――――――――――――――――――――――― --- src.orig/compose.c Fri Jan 11 16:47:49 2002 +++ src/compose.c Sat Jan 12 20:20:09 2002 @@ -157,7 +157,8 @@ MsgInfo *msginfo); static void compose_insert_sig (Compose *compose); static void compose_insert_file (Compose *compose, - const gchar *file); + const gchar *file, + gboolean should_parse); static void compose_attach_append (Compose *compose, const gchar *file, ContentType cnttype); @@ -1115,16 +1116,17 @@ "\n", 1); } - compose_insert_file(compose, sigfile); + compose_insert_file(compose, sigfile, FALSE); g_free(sigfile); } -static void compose_insert_file(Compose *compose, const gchar *file) +static void compose_insert_file(Compose *compose, const gchar *file, gboolean should_parse) { GtkSText *text = GTK_STEXT(compose->text); - gchar buf[BUFFSIZE]; + gchar buf[BUFFSIZE], *str; gint len; FILE *fp; + gboolean is_header_line = should_parse; g_return_if_fail(file != NULL); @@ -1144,7 +1146,58 @@ while (--len >= 0) if (buf[len] == '\r') buf[len] = '\n'; } - gtk_stext_insert(text, NULL, NULL, NULL, buf, -1); + + if (!is_header_line) { + gtk_stext_insert(text, NULL, NULL, NULL, buf, -1); + continue; + } + + if (!strncmp(buf, "----", 4)) { + is_header_line = FALSE; + continue; + } + + len = strlen(buf) - 1; + buf[len] = '\0'; + + /* check headers */ + + if (!strncasecmp(buf, "Subject:", strlen("Subject:"))) { + Xstrdup_a(str, buf + strlen("Subject:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), str); + + } else if (!strncasecmp(buf, "To:", strlen("To:"))) { + Xstrdup_a(str, buf + strlen("To:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->to_entry), str); + + } else if (!strncasecmp(buf, "Cc:", strlen("Cc:"))) { + Xstrdup_a(str, buf + strlen("Cc:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->cc_entry), str); + + } else if (!strncasecmp(buf, "Bcc:", strlen("Bcc:"))) { + Xstrdup_a(str, buf + strlen("Bcc:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->bcc_entry), str); + + } else if (!strncasecmp(buf, "Reply-To:", strlen("Reply-To"))) { + Xstrdup_a(str, buf + strlen("Reply-To:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->reply_entry), str); + + } else if (compose->account->protocol == A_NNTP) { + if (!strncasecmp(buf, "Newsgroups:", strlen("Newsgroups:"))) { + Xstrdup_a(str, buf + strlen("Newsgroups:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->newsgroups_entry), str); + } else if (!strncasecmp(buf, "Followup-To: ", 13)) { + Xstrdup_a(str, buf + strlen("Followup-To:"), return); + g_strstrip(str); + gtk_entry_set_text(GTK_ENTRY(compose->followup_entry), str); + } + } } gtk_stext_thaw(text); @@ -2018,6 +2071,62 @@ g_warning(_("can't change file mode\n")); } + /* write headers */ + + /* To */ + if (compose->use_to) { + fputs("To: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->to_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Newsgroups */ + if (compose->account->protocol == A_NNTP) { + fputs("Newsgroups: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->newsgroups_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Cc */ + if (compose->use_cc) { + fputs("Cc: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Bcc */ + if (compose->use_bcc) { + fputs("Bcc: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Reply-To */ + if (compose->use_replyto) { + fputs("Reply-To: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->reply_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Followup-To */ + if (compose->use_followupto) { + fputs("Followup-To: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->followup_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n", fp); + } + + /* Subject */ + fputs("Subject: ", fp); + chars = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry)); + if (*chars != '\0') fputs(chars, fp); + fputs("\n----\n", fp); + chars = gtk_editable_get_chars(GTK_EDITABLE(compose->text), 0, -1); /* write body */ @@ -3848,7 +3957,7 @@ gtk_stext_freeze(text); gtk_stext_set_point(text, 0); gtk_stext_forward_delete(text, gtk_stext_get_length(text)); - compose_insert_file(compose, compose->exteditor_file); + compose_insert_file(compose, compose->exteditor_file, TRUE); compose_changed_cb(NULL, compose); gtk_stext_thaw(text); @@ -4267,7 +4376,7 @@ file = filesel_select_file(_("Select file"), NULL); if (file) - compose_insert_file(compose, file); + compose_insert_file(compose, file, TRUE); } static gint compose_delete_cb(GtkWidget *widget, GdkEventAny *event, @@ -4622,7 +4731,7 @@ list = uri_list_extract_filenames((const gchar *)data->data); for (tmp = list; tmp != NULL; tmp = tmp->next) - compose_insert_file(compose, (const gchar *)tmp->data); + compose_insert_file(compose, (const gchar *)tmp->data, TRUE); list_free_strings(list); g_list_free(list); } ―――――――――――――――――――――――――――――――― どなたか、ご教示願います。 That's all for today. Bye for now. --- Sat Nov 16 00:18:05 2002 +0900 (JST) _/_/ Mailing with Linux-Sylpheed _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 長久保 博徳(鐘多) <shohta@xxxxxxxxxx> 2063 2002-11-15 18:47 [hiro-y@xxxxxxxxxx ] Sylpheed 0.8.6 released -> 2064 2002-11-16 00:18 ┗[shohta@xxxxxxxxxx ] 2065 2002-11-16 01:44 ┣[FZE01202@xxxxxxxxxx ] 2067 2002-11-16 06:55 ┃┗[shohta@xxxxxxxxxx ] 2068 2002-11-16 09:33 ┃ ┣[FZE01202@xxxxxxxxxx ] 2070 2002-11-16 10:25 ┃ ┃┗[naokih@xxxxxxxxxx ] 2069 2002-11-16 10:06 ┃ ┗[shitamo@xxxxxxxxxx ] 2071 2002-11-16 10:43 ┃ ┣[m-saki@xxxxxxxxxx ] 2073 2002-11-16 17:33 ┃ ┃┗[GGB03631@xxxxxxxxxx ] 2072 2002-11-16 16:21 ┃ ┗[shohta@xxxxxxxxxx ] 2066 2002-11-16 02:09 ┗[shitamo@xxxxxxxxxx ] |