]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-log-window.c
Merge branch 'gnome-3-8'
[empathy.git] / libempathy-gtk / empathy-log-window.c
index 6a244f503938313090cbac4d0cd93a8d01e17f9f..526569a510fd78e6da29ab7945f81ef64654dde6 100644 (file)
  */
 
 #include "config.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "empathy-log-window.h"
 
 #include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-#include <webkit/webkit.h>
-
-#include <telepathy-glib/telepathy-glib.h>
 #include <telepathy-glib/proxy-subclass.h>
 
-#include <telepathy-logger/telepathy-logger.h>
-
-#include <extensions/extensions.h>
-
-#include <libempathy/action-chain-internal.h>
-#include <libempathy/empathy-camera-monitor.h>
-#include <libempathy/empathy-chatroom-manager.h>
-#include <libempathy/empathy-chatroom.h>
-#include <libempathy/empathy-gsettings.h>
-#include <libempathy/empathy-message.h>
-#include <libempathy/empathy-request-util.h>
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-time.h>
-
-#include "empathy-log-window.h"
+#include "action-chain-internal.h"
 #include "empathy-account-chooser.h"
 #include "empathy-call-utils.h"
-#include "empathy-individual-information-dialog.h"
+#include "empathy-camera-monitor.h"
+#include "empathy-geometry.h"
+#include "empathy-gsettings.h"
 #include "empathy-images.h"
+#include "empathy-individual-information-dialog.h"
+#include "empathy-request-util.h"
 #include "empathy-theme-manager.h"
 #include "empathy-ui-utils.h"
+#include "empathy-utils.h"
 #include "empathy-webkit-utils.h"
-#include "empathy-geometry.h"
+#include "extensions.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
 #define EMPATHY_NS "http://live.gnome.org/Empathy"
 
@@ -1259,6 +1244,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 +1268,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),