+2002-02-11
+
+ * version 0.7.1
+
+2002-02-11
+
+ * src/compose.[ch]
+ src/gtkutils.[ch]
+ src/prefs_template.c
+ src/quote_fmt.h
+ src/quote_fmt_parse.y
+ src/summaryview.c
+ src/utils.[ch]: if the part of the message text is selected, use
+ it for quoted text instead of the entire message body (thanks to
+ Darko Koruga).
+ src/utils.[ch]: str_open_as_stream(): new. It returns an
+ temporary stream for the given string.
+ * src/main.c: added "--send" command line option.
+ * src/compose.c: compose_reply_set_entry(): add From address to
+ Cc if Reply-To and to_all are both specified.
+ * Makefile.am: correct the Source: line in the RPM spec file in
+ .tar.bz2 package.
+
2002-02-07
* src/procmsg.c: procmsg_open_message(): fetch message if the cache
+2002-02-11 [paul] 0.7.0claws58
+
+ * sync with sylpheed 0.7.1 release
+ see ChangeLog entries 2002-02-11
+
2002-02-08 [paul] 0.7.0claws57
* sync with sylpheed 0.7.0cvs39
+2002-02-11
+
+ * version 0.7.1
+
+2002-02-11
+
+ * src/compose.[ch]
+ src/gtkutils.[ch]
+ src/prefs_template.c
+ src/quote_fmt.h
+ src/quote_fmt_parse.y
+ src/summaryview.c
+ src/utils.[ch]: ¥á¥Ã¥»¡¼¥¸¥Æ¥¥¹¥È¤ÎÉôʬ¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢
+ ¥á¥Ã¥»¡¼¥¸ËÜʸÁ´ÂΤÎÂå¤ï¤ê¤Ë¤½¤ì¤ò°úÍÑʸ¤È¤·¤Æ»È¤¦¤è¤¦¤Ë¤·¤¿
+ (Darko Koruga ¤µ¤ó thanks)¡£
+ src/utils.[ch]: str_open_as_stream(): ¿·µ¬¡£Í¿¤¨¤é¤ì¤¿Ê¸»úÎó
+ ¤ËÂФ·¤Æ°ì»þŪ¤Ê¥¹¥È¥ê¡¼¥à¤òÊÖ¤¹¡£
+ * src/main.c: "--send" ¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤òÄɲá£
+ * src/compose.c: compose_reply_set_entry(): Reply-To ¤È to_all ¤¬
+ ξÊý»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð From ¤Î¥¢¥É¥ì¥¹¤ò Cc ¤ËÄɲá£
+ * Makefile.am: .tar.bz2 ¥Ñ¥Ã¥±¡¼¥¸Ãæ¤Î RPM spec ¥Õ¥¡¥¤¥ë¤Î Source:
+ ¹Ô¤ò½¤Àµ¡£
+
2002-02-07
* src/procmsg.c: procmsg_open_message(): ¥¥ã¥Ã¥·¥å¤¬Â¸ºß¤·¤Ê¤¤
README.jp \
README.claws \
TODO.jp \
+ sylpheed.desktop \
sylpheed.spec \
sylpheed.spec.in \
autogen.sh \
sylpheed.png \
- sylpheed.desktop \
ChangeLog.claws
if SYLPHEED_GNOME
release: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ rm -f $(distdir)/sylpheed.spec
+ sed '/^Source:/s/\.tar\.gz$$/\.tar\.bz2/' sylpheed.spec \
+ > $(distdir)/sylpheed.spec
BZIP2=$(BZIP2_ENV) $(TAR) --bzip2 -chof $(distdir).tar.bz2 $(distdir)
-rm -rf $(distdir)
* "Show all header" now displays the headers in the current message
view.
* File save dialog has been improved.
+ * '--send' option has been added.
+ * Quoted part of message text on reply or forward is specifiable by
+ selecting it.
+ * From address is now added to Cc entry when 'Reply to all' is used
+ on the messages which have Reply-To header.
* Mac OS X (Darwin) has been supported.
* Ctrl-Enter now works on the composition window.
+ * It now compiles with C compilers other than gcc.
* Crash in mark processing on 64bit architecture has been fixed.
- * Crash when some fonts couldn't be loaded has been fixed.
+ * Crash on font load failure has been fixed.
* Some address completion bugs have been fixed.
* Some many other bugs have been fixed.
o ¥ª¥ê¥¸¥Ê¥ë¤Î¥¢¥¤¥³¥ó¤È¥í¥´
o ¼«Æ°Êݸµ¡Ç½
o ¿¶¤êʬ¤±½èÍý¤Î¶¯²½
-o ¿¶¤êʬ¤±¤ÇÀµµ¬É½¸½¤ËÂбþ¤¹¤ë
-o MH, mbox °Ê³°¤Î·Á¼°¤Ø¤ÎÂбþ(Maildir Åù)
+o MH, mbox °Ê³°¤Î·Á¼°¤Ø¤ÎÂбþ (Maildir Åù)
o ½ÅÍ×ÅÙ (Priority:, X-Priority:, X-MSMail-Priority:)
o ¼õ¿®³Îǧ (Disposition-Notification-To:)
-o ¥¡¼¥Ð¥¤¥ó¥É¤Î¥«¥¹¥¿¥Þ¥¤¥º
o ¥Ä¡¼¥ë¥Ð¡¼¤Î¥«¥¹¥¿¥Þ¥¤¥º
o ¥Õ¥©¥ë¥ÀËè¤ÎÀßÄê
o RFC 2231 (MIME ¥Õ¥¡¥¤¥ë̾¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°) Âбþ
. HTML¥á¡¼¥ë¤Îɽ¼¨ (HTML¥á¡¼¥ë¤ÎºîÀ®¤ÏͽÄê¤Ê¤·:-P)
. »þ´Ö¤¬³Ý¤«¤ë½èÍý¤Î¿ÊĽ¾õ¶·É½¼¨
. Á÷¼õ¿®¤È¤½¤ì°Ê³°¤È¤ÎʹԽèÍý
+. ¥¡¼¥Ð¥¤¥ó¥É¤Î¥«¥¹¥¿¥Þ¥¤¥º
¼ÂÁõºÑ¤Îµ¡Ç½
============
* LDAPÂбþ
* ¥á¥Ã¥»¡¼¥¸¤ÎÁ´Ê¸¸¡º÷ (¥Ù¥¿)
* ¥Æ¥ó¥×¥ì¡¼¥Èµ¡Ç½
+* ¿¶¤êʬ¤±¤ÇÀµµ¬É½¸½¤ËÂбþ¤¹¤ë
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws57
+EXTRA_VERSION=claws58
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
MsgInfo *msginfo,
const gchar *fmt,
const gchar *qmark,
- const gchar *seltext);
+ const gchar *body);
static void compose_reply_set_entry (Compose *compose,
MsgInfo *msginfo,
gboolean to_all,
gboolean ignore_replyto,
gboolean followup_and_reply_to,
- const gchar *seltext);
+ const gchar *body);
void compose_headerentry_changed_cb (GtkWidget *entry,
ComposeHeaderEntry *headerentry);
*/
void compose_reply(MsgInfo *msginfo, gboolean quote, gboolean to_all,
- gboolean ignore_replyto, const gchar *seltext)
+ gboolean ignore_replyto, const gchar *body)
{
compose_generic_reply(msginfo, quote, to_all, ignore_replyto, FALSE,
- seltext);
+ body);
}
void compose_followup_and_reply_to(MsgInfo *msginfo, gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
- const gchar *seltext)
+ const gchar *body)
{
compose_generic_reply(msginfo, quote, to_all, ignore_replyto, TRUE,
- seltext);
+ body);
}
static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
gboolean followup_and_reply_to,
- const gchar *seltext)
+ const gchar *body)
{
Compose *compose;
PrefsAccount *account;
quote_str = compose_quote_fmt(compose, msginfo,
prefs_common.quotefmt,
- qmark, seltext);
+ qmark, body);
}
if (prefs_common.auto_sig)
}
Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
- gboolean as_attach, const gchar *seltext)
+ gboolean as_attach, const gchar *body)
{
Compose *compose;
/* PrefsAccount *account; */
quote_str = compose_quote_fmt(compose, msginfo,
prefs_common.fw_quotefmt, qmark,
- seltext);
+ body);
compose_attach_parts(compose, msginfo);
}
static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
const gchar *fmt, const gchar *qmark,
- const gchar *seltext)
+ const gchar *body)
{
GtkSText *text = GTK_STEXT(compose->text);
gchar *quote_str = NULL;
}
if (fmt && *fmt != '\0') {
- quote_fmt_init(msginfo, quote_str, seltext);
+ quote_fmt_init(msginfo, quote_str, body);
quote_fmt_scan_string(fmt);
quote_fmt_parse();
gboolean to_all, gboolean ignore_replyto,
gboolean followup_and_reply_to)
{
- GSList *cc_list;
+ GSList *cc_list = NULL;
GSList *cur;
- gchar *from;
+ gchar *from = NULL;
+ gchar *replyto = NULL;
GHashTable *to_table;
g_return_if_fail(compose->account != NULL);
: msginfo->from ? msginfo->from : ""),
COMPOSE_TO);
- if (compose->replyto && to_all)
- compose_entry_append
- (compose, compose->replyto, COMPOSE_CC);
-
-
if (compose->account->protocol == A_NNTP) {
if (ignore_replyto)
compose_entry_append
if (!to_all || compose->account->protocol == A_NNTP) return;
- from = g_strdup(compose->replyto ? compose->replyto :
- msginfo->from ? msginfo->from : "");
- extract_address(from);
+ if (compose->replyto) {
+ Xstrdup_a(replyto, compose->replyto, return);
+ extract_address(replyto);
+ }
+ if (msginfo->from) {
+ Xstrdup_a(from, msginfo->from, return);
+ extract_address(from);
+ }
+
+ if (compose->mailinglist && from) {
+ cc_list = address_list_append(cc_list, from);
+ }
+
+ if (replyto && from)
+ cc_list = address_list_append(cc_list, from);
+
+ if (!compose->mailinglist)
+ cc_list = address_list_append(cc_list, msginfo->to);
- cc_list = address_list_append(NULL, msginfo->to);
cc_list = address_list_append(cc_list, compose->cc);
to_table = g_hash_table_new(g_str_hash, g_str_equal);
- g_hash_table_insert(to_table, from, GINT_TO_POINTER(1));
+ if (replyto)
+ g_hash_table_insert(to_table, replyto, GINT_TO_POINTER(1));
if (compose->account)
g_hash_table_insert(to_table, compose->account->address,
GINT_TO_POINTER(1));
cur = next;
}
g_hash_table_destroy(to_table);
- g_free(from);
if (cc_list) {
for (cur = cc_list; cur != NULL; cur = cur->next)
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
- const gchar *seltext);
+ const gchar *body);
void compose_reply (MsgInfo *msginfo,
gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
- const gchar *seltext);
+ const gchar *body);
Compose *compose_forward (PrefsAccount *account,
MsgInfo *msginfo,
gboolean as_attach,
- const gchar *seltext);
+ const gchar *body);
Compose *compose_forward_multiple (PrefsAccount *account,
GSList *msginfo_list);
Compose *compose_bounce (PrefsAccount *account,
g_list_free(combo_items);
}
+gchar *gtkut_editable_get_selection(GtkEditable *editable)
+{
+ guint start_pos, end_pos;
+
+ g_return_if_fail(editable != NULL);
+
+ if (!editable->has_selection) return NULL;
+
+ if (editable->selection_start_pos < editable->selection_end_pos) {
+ start_pos = editable->selection_start_pos;
+ end_pos = editable->selection_end_pos;
+ } else {
+ start_pos = editable->selection_end_pos;
+ end_pos = editable->selection_start_pos;
+ }
+
+ return gtk_editable_get_chars(editable, start_pos, end_pos);
+}
+
/*
* Walk through the widget tree and disclaim the selection from all currently
* realized GtkEditable widgets.
}
gdk_window_set_icon(widget->window, NULL, xpm, bmp);
}
-
-gchar *gtkut_get_selection(GtkWidget *widget)
-{
- gchar *seltext = NULL;
- guint start_pos, end_pos;
- GtkEditable *editable = (GtkEditable *) widget;
-
- if (editable->has_selection) {
- if (editable->selection_start_pos < editable->selection_end_pos) {
- start_pos = editable->selection_start_pos;
- end_pos = editable->selection_end_pos;
- }
- else {
- start_pos = editable->selection_end_pos;
- end_pos = editable->selection_start_pos;
- }
-
- seltext = gtk_editable_get_chars(editable, start_pos, end_pos);
- }
-
- return seltext;
-}
void gtkut_combo_set_items (GtkCombo *combo,
const gchar *str1, ...);
+gchar *gtkut_editable_get_selection (GtkEditable *editable);
+
void gtkut_container_remove (GtkContainer *container,
GtkWidget *widget);
void gtkut_widget_set_app_icon (GtkWidget *widget);
void gtkut_widget_set_composer_icon (GtkWidget *widget);
-
-gchar *gtkut_get_selection (GtkWidget *widget);
#endif /* __GTKUTILS_H__ */
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "import.h"
#include "manage_window.h"
#include "alertpanel.h"
+#include "statusbar.h"
#include "addressbook.h"
#include "compose.h"
#include "folder.h"
static void open_compose_new_with_recipient (const gchar *address);
+static void send_queue (void);
+
#if 0
/* for gettext */
_("File `%s' already exists.\n"
inc_autocheck_timer_init(mainwin);
+ /* ignore SIGPIPE signal for preventing sudden death of program */
+ signal(SIGPIPE, SIG_IGN);
+
if (cmd.receive_all || prefs_common.chk_on_startup)
inc_all_account_mail(mainwin);
else if (cmd.receive)
if (cmd.compose)
open_compose_new_with_recipient(cmd.compose_mailto);
-
- if (cmd.send) {
- if (procmsg_send_queue() < 0)
- alertpanel_error(_("Some errors occurred while sending queued messages."));
- }
-
- /* ignore SIGPIPE signal for preventing sudden death of program */
- signal(SIGPIPE, SIG_IGN);
+ if (cmd.send)
+ send_queue();
gtk_main();
cmd.compose_mailto = p;
i++;
}
+ } else if (!strncmp(argv[i], "--send", 6)) {
+ cmd.send = TRUE;
} else if (!strncmp(argv[i], "--version", 9)) {
puts("Sylpheed version " VERSION);
exit(0);
} else if (!strncmp(argv[i], "--status", 8)) {
cmd.status = TRUE;
- } else if (!strncmp(argv[i], "--send", 6)) {
- cmd.send = TRUE;
} else if (!strncmp(argv[i], "--help", 6)) {
g_print(_("Usage: %s [OPTION]...\n"),
g_basename(argv[0]));
puts(_(" --compose [address] open composition window"));
puts(_(" --receive receive new messages"));
puts(_(" --receive-all receive new messages of all accounts"));
- puts(_(" --send send all queued messages"));
+ puts(_(" --send send all queued messages"));
puts(_(" --status show the total number of messages"));
puts(_(" --debug debug mode"));
puts(_(" --help display this help and exit"));
fd_write(uxsock, "receive_all\n", 12);
else if (cmd.receive)
fd_write(uxsock, "receive\n", 8);
- else if (cmd.send) {
- gchar buf[BUFFSIZE];
-
- fd_write(uxsock, "send\n", 5);
- fd_gets(uxsock, buf, sizeof(buf));
- fputs(buf, stdout);
- }
else if (cmd.compose) {
gchar *compose_str;
fd_write(uxsock, compose_str, strlen(compose_str));
g_free(compose_str);
+ } else if (cmd.send) {
+ fd_write(uxsock, "send\n", 5);
} else if (cmd.status) {
gchar buf[BUFFSIZE];
} else if (!strncmp(buf, "receive", 7)){
main_window_popup(mainwin);
inc_mail(mainwin);
- } else if (!strncmp(buf, "send", 4)) {
- gint queued = get_queued_message_num();
-
- if (queued > 0) {
- if (procmsg_send_queue() < 0)
- g_snprintf(buf, sizeof(buf),
- "%s\n", /* avoids adding another translatable */
- _("Some errors occurred while sending queued messages."));
- else /* queue sent ok */
- g_snprintf(buf, sizeof(buf), _("\%d queued message(s) sent\n"), queued);
- }
- else {
- g_snprintf(buf, sizeof(buf), "%s\n", _("No queued messages found."));
- }
- fd_write(sock, buf, strlen(buf));
} else if (!strncmp(buf, "compose", 7)) {
open_compose_new_with_recipient(buf + strlen("compose") + 1);
+ } else if (!strncmp(buf, "send", 4)) {
+ send_queue();
} else if (!strncmp(buf, "status", 6)) {
guint new, unread, total;
static void open_compose_new_with_recipient(const gchar *address)
{
gchar *addr = NULL;
-
+
if (address) {
Xstrdup_a(addr, address, return);
g_strstrip(addr);
else
compose_new(NULL);
}
+
+static void send_queue(void)
+{
+ GList *list;
+
+ if (procmsg_send_queue() < 0)
+ alertpanel_error(_("Some errors occurred while sending queued messages."));
+
+ statusbar_pop_all();
+
+ for (list = folder_get_list(); list != NULL; list = list->next) {
+ Folder *folder;
+
+ folder = list->data;
+ if (folder->queue) {
+ folder_item_scan(folder->queue);
+ folderview_update_item(folder->queue, TRUE);
+ }
+ }
+}
#define quote_fmt_parse quote_fmtparse
gchar *quote_fmt_get_buffer(void);
-void quote_fmt_init(MsgInfo *info, gchar *my_quote_str, const gchar *seltext);
+void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
+ const gchar *my_body);
gint quote_fmtparse(void);
void quote_fmt_scan_string(const gchar *str);
static MsgInfo *msginfo = NULL;
static gboolean *visible = NULL;
-static gchar *seltext = NULL;
static gint maxsize = 0;
static gint stacksize = 0;
static gchar *buffer = NULL;
static gint bufmax = 0;
static gint bufsize = 0;
-static gchar *quote_str = NULL;
+static const gchar *quote_str = NULL;
+static const gchar *body = NULL;
static gint error = 0;
static void add_visibility(gboolean val)
stacksize--;
}
-static void add_buffer(gchar *s)
+static void add_buffer(const gchar *s)
{
gint len;
add_buffer(tmp); \
}
-void quote_fmt_init(MsgInfo *info, gchar *my_quote_str,
- const gchar *selectiontext)
+void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
+ const gchar *my_body)
{
quote_str = my_quote_str;
+ body = my_body;
msginfo = info;
- seltext = (gchar *) selectiontext;
stacksize = 0;
add_visibility(TRUE);
if (buffer != NULL)
}
| SHOW_MESSAGE
{
- if (seltext) {
- INSERT(seltext);
- }
- else if (msginfo->folder) {
+ if (msginfo->folder) {
gchar buf[BUFFSIZE];
FILE *fp;
- if ((fp = procmime_get_first_text_content(msginfo))
- == NULL)
+ if (body)
+ fp = str_open_as_stream(body);
+ else
+ fp = procmime_get_first_text_content(msginfo);
+
+ if (fp == NULL)
g_warning(_("Can't get text part\n"));
else {
while (fgets(buf, sizeof(buf), fp) != NULL) {
}
| SHOW_QUOTED_MESSAGE
{
- gchar *tmp_file = NULL;
-
- if (seltext)
- tmp_file = write_buffer_to_file(seltext,
- strlen(seltext));
-
- if (msginfo->folder || tmp_file) {
+ if (msginfo->folder) {
gchar buf[BUFFSIZE];
FILE *fp;
- if (tmp_file)
- fp = fopen(tmp_file, "r");
+ if (body)
+ fp = str_open_as_stream(body);
else
fp = procmime_get_first_text_content(msginfo);
fclose(fp);
}
}
-
- if (tmp_file)
- unlink(tmp_file);
}
| SHOW_MESSAGE_NO_SIGNATURE
{
- gchar *tmp_file = NULL;
-
- if (seltext)
- tmp_file = write_buffer_to_file(seltext,
- strlen(seltext));
-
if (msginfo->folder) {
gchar buf[BUFFSIZE];
FILE *fp;
- if (tmp_file)
- fp = fopen(tmp_file, "r");
+ if (body)
+ fp = str_open_as_stream(body);
else
fp = procmime_get_first_text_content(msginfo);
fclose(fp);
}
}
-
- if (tmp_file)
- unlink(tmp_file);
}
| SHOW_QUOTED_MESSAGE_NO_SIGNATURE
{
- gchar *tmp_file = NULL;
-
- if (seltext)
- tmp_file = write_buffer_to_file(seltext,
- strlen(seltext));
-
- if (msginfo->folder || tmp_file) {
+ if (msginfo->folder) {
gchar buf[BUFFSIZE];
FILE *fp;
- if (tmp_file)
- fp = fopen(tmp_file, "r");
+ if (body)
+ fp = str_open_as_stream(body);
else
fp = procmime_get_first_text_content(msginfo);
fclose(fp);
}
}
-
- if (tmp_file)
- unlink(tmp_file);
}
| SHOW_BACKSLASH
{
void summary_reply(SummaryView *summaryview, ComposeMode mode)
{
GtkWidget *widget;
+ GList *sel = GTK_CLIST(summaryview->ctree)->selection;
MsgInfo *msginfo;
- GList *sel = GTK_CLIST(summaryview->ctree)->selection;
- gchar *seltext = NULL;
+ gchar *text;
msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
summaryview->selected);
if (!msginfo) return;
- if (summaryview && summaryview->messageview &&
- summaryview->messageview->textview &&
- summaryview->messageview->textview->text)
- seltext = gtkut_get_selection(
- summaryview->messageview->textview->text);
+ text = gtkut_editable_get_selection
+ (GTK_EDITABLE(summaryview->messageview->textview->text));
switch (mode) {
case COMPOSE_REPLY:
compose_reply(msginfo, prefs_common.reply_with_quote,
- FALSE, FALSE, seltext);
+ FALSE, FALSE, text);
break;
case COMPOSE_REPLY_WITH_QUOTE:
- compose_reply(msginfo, TRUE, FALSE, FALSE, seltext);
+ compose_reply(msginfo, TRUE, FALSE, FALSE, text);
break;
case COMPOSE_REPLY_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, FALSE, FALSE, seltext);
+ compose_reply(msginfo, FALSE, FALSE, FALSE, NULL);
break;
case COMPOSE_REPLY_TO_SENDER:
compose_reply(msginfo, prefs_common.reply_with_quote,
- FALSE, TRUE, seltext);
+ FALSE, TRUE, text);
break;
case COMPOSE_FOLLOWUP_AND_REPLY_TO:
compose_followup_and_reply_to(msginfo,
prefs_common.reply_with_quote,
- FALSE, TRUE, seltext);
+ FALSE, TRUE, text);
break;
case COMPOSE_REPLY_TO_SENDER_WITH_QUOTE:
- compose_reply(msginfo, TRUE, FALSE, TRUE, seltext);
+ compose_reply(msginfo, TRUE, FALSE, TRUE, text);
break;
case COMPOSE_REPLY_TO_SENDER_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, FALSE, TRUE, seltext);
+ compose_reply(msginfo, FALSE, FALSE, TRUE, NULL);
break;
case COMPOSE_REPLY_TO_ALL:
compose_reply(msginfo, prefs_common.reply_with_quote,
- TRUE, TRUE, seltext);
+ TRUE, FALSE, text);
break;
case COMPOSE_REPLY_TO_ALL_WITH_QUOTE:
- compose_reply(msginfo, TRUE, TRUE, TRUE, seltext);
+ compose_reply(msginfo, TRUE, TRUE, FALSE, text);
break;
case COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, TRUE, TRUE, seltext);
+ compose_reply(msginfo, FALSE, TRUE, FALSE, NULL);
break;
case COMPOSE_FORWARD:
if (prefs_common.forward_as_attachment) {
break;
case COMPOSE_FORWARD_INLINE:
if (!sel->next) {
- compose_forward(NULL, msginfo, FALSE, seltext);
+ compose_forward(NULL, msginfo, FALSE, text);
break;
}
/* if (sel->next) FALL THROUGH */
}
summary_set_marks_selected(summaryview);
-
- if (seltext)
- g_free((gchar *) seltext);
+ g_free(text);
}
/* color label */
return tmpfile();
}
-gchar *write_buffer_to_file(const gchar *buf, guint bufsize)
+FILE *str_open_as_stream(const gchar *str)
{
FILE *fp;
- gchar *tmp_file = NULL;
+ size_t len;
+
+ g_return_val_if_fail(str != NULL, NULL);
+
+ fp = my_tmpfile();
+ if (!fp) {
+ FILE_OP_ERROR("str_open_as_stream", "my_tmpfile");
+ return NULL;
+ }
- tmp_file = get_tmp_file();
- fp = fopen(tmp_file, "w");
- if (fp) {
- fwrite(buf, 1, bufsize, fp);
+ len = strlen(str);
+ if (fwrite(str, len, 1, fp) != 1) {
+ FILE_OP_ERROR("str_open_as_stream", "fwrite");
fclose(fp);
+ return NULL;
}
- else tmp_file = NULL;
- return tmp_file;
+ rewind(fp);
+ return fp;
}
gint execute_async(gchar *const argv[])
gint change_file_mode_rw (FILE *fp,
const gchar *file);
FILE *my_tmpfile (void);
-gchar *write_buffer_to_file (const gchar *buf,
- guint bufsize);
+FILE *str_open_as_stream (const gchar *str);
#define is_file_exist(file) file_exist(file, FALSE)
#define is_file_or_fifo_exist(file) file_exist(file, TRUE)