Revision 3237

View differences:

src/compose.c
1 1
/*
2 2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2012 Hiroyuki Yamamoto
3
 * Copyright (C) 1999-2013 Hiroyuki Yamamoto
4 4
 *
5 5
 * This program is free software; you can redistribute it and/or modify
6 6
 * it under the terms of the GNU General Public License as published by
......
6208 6208
	GtkTextBuffer *buffer;
6209 6209
	GtkTextMark *mark;
6210 6210
	GtkTextIter iter;
6211
	gchar *parsed_str;
6211
	gchar *parsed_str = NULL;
6212 6212

  
6213 6213
	if (!tmpl || !tmpl->value) return;
6214 6214

  
......
6233 6233
	mark = gtk_text_buffer_get_insert(buffer);
6234 6234
	gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
6235 6235

  
6236
	if (compose->reply_target == NULL) {
6237
		parsed_str = compose_quote_fmt(compose, NULL, tmpl->value,
6238
					       NULL, NULL);
6239
	} else {
6236
	if (compose->reply_target) {
6240 6237
		FolderItem *item;
6241 6238
		gint num;
6242 6239
		MsgInfo *msginfo = NULL;
6240
		MsgInfo *full_msginfo;
6243 6241

  
6244 6242
		item = folder_find_item_and_num_from_id(compose->reply_target,
6245 6243
							&num);
6246
		if (item && num > 0)
6244
		if (item && num > 0) {
6247 6245
			msginfo = folder_item_get_msginfo(item, num);
6246
			if (msginfo) {
6247
				full_msginfo = procmsg_msginfo_get_full_info(msginfo);
6248
				if (full_msginfo) {
6249
					procmsg_msginfo_free(msginfo);
6250
					msginfo = full_msginfo;
6251
				}
6252
			}
6253
		}
6248 6254
		parsed_str = compose_quote_fmt(compose, msginfo,
6249 6255
					       tmpl->value,
6250 6256
					       prefs_common.quotemark, NULL);
6251 6257
		procmsg_msginfo_free(msginfo);
6258
	} else if (compose->forward_targets) {
6259
		FolderItem *item;
6260
		gint num;
6261
		gchar **targets;
6262
		gint i;
6263
		MsgInfo *msginfo;
6264
		MsgInfo *full_msginfo;
6265

  
6266
		targets = g_strsplit(compose->forward_targets, "\n", 0);
6267

  
6268
		for (i = 0; targets[i] != NULL; i++) {
6269
			g_strstrip(targets[i]);
6270
			item = folder_find_item_and_num_from_id(targets[i], &num);
6271
			if (!item || num <= 0)
6272
				continue;
6273
			msginfo = procmsg_get_msginfo(item, num);
6274
			if (!msginfo)
6275
				continue;
6276
			full_msginfo = procmsg_msginfo_get_full_info(msginfo);
6277
			parsed_str = compose_quote_fmt(compose, full_msginfo ? full_msginfo : msginfo,
6278
						       tmpl->value,
6279
						       prefs_common.fw_quotemark, NULL);
6280
			procmsg_msginfo_free(full_msginfo);
6281
			procmsg_msginfo_free(msginfo);
6282
		}
6283
		g_strfreev(targets);
6284
	} else {
6285
		parsed_str = compose_quote_fmt(compose, NULL, tmpl->value,
6286
					       NULL, NULL);
6252 6287
	}
6253 6288

  
6254 6289
	if (replace && parsed_str && prefs_common.auto_sig)
ChangeLog
1 1
2013-03-28
2 2

  
3
	* src/compose.c: compose_template_apply(): enabled quotation of
4
	  messages on forwarding.
5

  
6
2013-03-28
7

  
3 8
	* src/compose.c: refactored compose_quote_fmt().
4 9

  
5 10
2013-03-26

Also available in: Unified diff