From 0569ded29dbab08462670e4780fb17ec5e4950ff Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Wed, 18 May 2011 15:57:55 +1000 Subject: [theme-adium] wrap the messages in so we can find them again This will enable our DOM manipulation --- libempathy-gtk/empathy-theme-adium.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 0370b9055..6c5ae7910 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -315,7 +315,8 @@ static EmpathyStringParser string_parsers_with_smiley[] = { static gchar * theme_adium_parse_body (EmpathyThemeAdium *self, - const gchar *text) + const gchar *text, + const gchar *token) { EmpathyThemeAdiumPriv *priv = GET_PRIV (self); EmpathyStringParser *parsers; @@ -332,8 +333,19 @@ theme_adium_parse_body (EmpathyThemeAdium *self, * by html tags. Also escape text to make sure html code is * displayed verbatim. */ string = g_string_sized_new (strlen (text)); + + /* wrap this in HTML that allows us to find the message for later + * editing */ + if (!tp_str_empty (token)) + g_string_append_printf (string, + "", + token); + empathy_string_parser_substr (text, -1, parsers, string); + if (!tp_str_empty (token)) + g_string_append (string, ""); + /* Wrap body in order to make tabs and multiple spaces displayed * properly. See bug #625745. */ g_string_prepend (string, "