]> 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 f386388807f951437512509cebfd48c1fd0b9d28..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-chat-view.h"
-#include "empathy-contact-dialogs.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"
 
@@ -320,11 +304,17 @@ static void
 toolbutton_profile_clicked (GtkToolButton *toolbutton,
     EmpathyLogWindow *self)
 {
+  FolksIndividual *individual;
+
   g_return_if_fail (self != NULL);
   g_return_if_fail (EMPATHY_IS_CONTACT (self->priv->selected_contact));
 
-  empathy_contact_information_dialog_show (self->priv->selected_contact,
-      GTK_WINDOW (self));
+  individual = empathy_ensure_individual_from_tp_contact (
+      empathy_contact_get_tp_contact (self->priv->selected_contact));
+
+  empathy_display_individual_info (individual);
+
+  g_object_unref (individual);
 }
 
 static void
@@ -1254,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;
@@ -1277,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),
@@ -2494,7 +2489,7 @@ log_window_who_populate (EmpathyLogWindow *self)
       GList *accounts, *l;
 
       manager = empathy_account_chooser_get_account_manager (account_chooser);
-      accounts = tp_account_manager_get_valid_accounts (manager);
+      accounts = tp_account_manager_dup_valid_accounts (manager);
 
       for (l = accounts; l != NULL; l = l->next)
         {
@@ -2505,7 +2500,7 @@ log_window_who_populate (EmpathyLogWindow *self)
               get_entities_for_account, ctx);
         }
 
-      g_list_free (accounts);
+      g_list_free_full (accounts, g_object_unref);
     }
   _tpl_action_chain_append (self->priv->chain, select_first_entity, self);
   _tpl_action_chain_start (self->priv->chain);