aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index c78182128d..97433457a0 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -310,15 +310,15 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...)
}
if (is_html) {
- ret_text = g_strdup_printf ("<blockquote><i><font color=\"%06x\">\n%s%s%s\n"
- "</font></i></blockquote>\n",
- mail_config_get_citation_color (),
+ ret_text = g_strdup_printf ("%s<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->"
+ "<blockquote><i><font color=\"%06x\">\n%s\n"
+ "</font></i></blockquote>"
+ "<!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->",
credits ? credits : "",
- credits ? "\n" : "",
- text);
+ mail_config_get_citation_color (), text);
} else {
- gchar *s, *d, *quoted_text;
- gint lines, len, offset = 0;
+ gchar *s, *d, *quoted_text, *orig_text;
+ gint lines, len;
/* Count the number of lines in the body. If
* the text ends with a \n, this will be one
@@ -328,21 +328,15 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...)
for (s = text, lines = 0; s; s = strchr (s + 1, '\n'))
lines++;
- offset = credits ? strlen (credits) : 0;
-
/* offset is the size of the credits, strlen (text)
* covers the body, lines * 2 does the "> "s, and
* the last +2 covers the final "\0", plus an extra
* "\n" in case text doesn't end with one.
*/
- quoted_text = g_malloc (offset + strlen (text) +
- lines * 2 + 2);
-
- if (credits)
- memcpy (quoted_text, credits, offset);
+ quoted_text = g_malloc (strlen (text) + lines * 2 + 2);
s = text;
- d = quoted_text + offset;
+ d = quoted_text;
/* Copy text to quoted_text line by line,
* prepending "> ".
@@ -360,14 +354,21 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...)
*d = '\0';
/* Now convert that to HTML. */
- ret_text = e_text_to_html_full (quoted_text, E_TEXT_TO_HTML_PRE
- | (mail_config_get_citation_highlight ()
- ? E_TEXT_TO_HTML_MARK_CITATION : 0),
- mail_config_get_citation_color ());
+ orig_text = e_text_to_html_full (quoted_text, E_TEXT_TO_HTML_PRE
+ | (mail_config_get_citation_highlight ()
+ ? E_TEXT_TO_HTML_MARK_CITATION : 0),
+ mail_config_get_citation_color ());
g_free (quoted_text);
+ ret_text = g_strdup_printf ("%s<!--+GtkHTML:<DATA class=\"ClueFlow\" key=\"orig\" value=\"1\">-->"
+ "%s"
+ "<!--+GtkHTML:<DATA class=\"ClueFlow\" clear=\"orig\">-->",
+ credits ? credits : "",
+ orig_text);
+ g_free (orig_text);
}
g_free (text);
+ printf ("ret: %s\n", ret_text);
return ret_text;
}