diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-01-04 23:08:39 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-01-07 21:04:35 +0800 |
commit | 1e7449f5a14e2f031389808206c9991f65d3ade7 (patch) | |
tree | 3083d503576eebed9c5098c670aa1189af1ddb68 | |
parent | 1f58b2c7809a6489c069aff8b1b9d1e114bc3f2c (diff) | |
download | gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar.gz gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar.bz2 gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar.lz gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar.xz gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.tar.zst gsoc2013-empathy-1e7449f5a14e2f031389808206c9991f65d3ade7.zip |
log-window: escape the body of the message
https://bugzilla.gnome.org/show_bug.cgi?id=691085
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 6a244f503..3bc2967fd 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -1259,6 +1259,7 @@ log_window_append_chat_message (TplEvent *event, GtkTreeStore *store = log_window->priv->store_events; GtkTreeIter iter, parent; gchar *pretty_date, *alias, *body; + gchar *msg_escaped; GDateTime *date; EmpathyStringParser *parsers; GString *msg; @@ -1282,19 +1283,23 @@ log_window_append_chat_message (TplEvent *event, empathy_string_parser_substr (empathy_message_get_body (message), -1, parsers, msg); + msg_escaped = g_strescape (msg->str, NULL); + if (tpl_text_event_get_message_type (TPL_TEXT_EVENT (event)) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) { /* Translators: this is an emote: '* Danielle waves' */ - body = g_strdup_printf (_("<i>* %s %s</i>"), alias, msg->str); + body = g_strdup_printf (_("<i>* %s %s</i>"), alias, msg_escaped); } else { /* Translators: this is a message: 'Danielle: hello' * The string in bold is the sender's name */ - body = g_strdup_printf (_("<b>%s:</b> %s"), alias, msg->str); + body = g_strdup_printf (_("<b>%s:</b> %s"), alias, msg_escaped); } + g_free (msg_escaped); + gtk_tree_store_append (store, &iter, &parent); gtk_tree_store_set (store, &iter, COL_EVENTS_TS, tpl_event_get_timestamp (event), |