From 9d1b442e15c3234388ac93a5b08d5904f3ca54c9 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 20 Oct 2008 21:04:13 +0000 Subject: [PATCH 1/1] * Now we put signatures before the original/forwarded messages (fixes NB#89331). * We also make sure the first line is a blank line on messages. pmo-trunk-r6130 --- src/modest-text-utils.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 54d7679..609659f 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -215,11 +215,11 @@ modest_text_utils_cite (const gchar *text, if (!signature) retval = g_strdup (""); else if (strcmp(content_type, "text/html") == 0) { - tmp_sig = g_strconcat (SIGNATURE_MARKER,"\n", signature, NULL); + tmp_sig = g_strconcat ("\n", SIGNATURE_MARKER,"\n", signature, NULL); retval = modest_text_utils_convert_to_html_body(tmp_sig, -1, TRUE); g_free (tmp_sig); } else { - retval = g_strconcat (text, SIGNATURE_MARKER, "\n", signature, NULL); + retval = g_strconcat (text, "\n", SIGNATURE_MARKER, "\n", signature, NULL); } return retval; @@ -881,7 +881,14 @@ modest_text_utils_quote_plain_text (const gchar *text, gsize len; gchar *attachments_string = NULL; - q = g_string_new ("\n"); + q = g_string_new (""); + + if (signature != NULL) { + q = g_string_append (q, "\n--\n"); + q = g_string_append (q, signature); + } + + q = g_string_append (q, "\n"); q = g_string_append (q, cite); q = g_string_append_c (q, '\n'); @@ -932,12 +939,6 @@ modest_text_utils_quote_plain_text (const gchar *text, q = g_string_append (q, attachments_string); g_free (attachments_string); - if (signature != NULL) { - q = g_string_append (q, "\n--\n"); - q = g_string_append (q, signature); - q = g_string_append_c (q, '\n'); - } - return g_string_free (q, FALSE); } @@ -965,10 +966,14 @@ modest_text_utils_quote_html (const gchar *text, g_string_new ( \ "\n" \ "\n" \ - "\n"); + "\n
\n"); if (text || cite || signature) { - g_string_append (result_string, "
");
+		g_string_append (result_string, "
\n");
+		if (signature) {
+			quote_html_add_to_gstring (result_string, SIGNATURE_MARKER);
+			quote_html_add_to_gstring (result_string, signature);
+		}
 		quote_html_add_to_gstring (result_string, cite);
 		quote_html_add_to_gstring (result_string, text);
 		if (attachments) {
@@ -976,10 +981,6 @@ modest_text_utils_quote_html (const gchar *text,
 			quote_html_add_to_gstring (result_string, attachments_string);
 			g_free (attachments_string);
 		}
-		if (signature) {
-			quote_html_add_to_gstring (result_string, SIGNATURE_MARKER);
-			quote_html_add_to_gstring (result_string, signature);
-		}
 		g_string_append (result_string, "
"); } g_string_append (result_string, ""); -- 1.7.9.5