]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-individual-widget.c
Center the 'smiley images' inside the menu items
[empathy.git] / libempathy-gtk / empathy-individual-widget.c
index 8910954f70788ae971c9759737204f021266e982..fac2c5a1bd46cf42ecfb0186a083dd4e0c289c35 100644 (file)
 
 #include <glib/gi18n-lib.h>
 #include <tp-account-widgets/tpaw-builder.h>
+#include <tp-account-widgets/tpaw-contactinfo-utils.h>
 #include <tp-account-widgets/tpaw-time.h>
+#include <tp-account-widgets/tpaw-utils.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
 
 #ifdef HAVE_LIBCHAMPLAIN
 #include <champlain/champlain.h>
@@ -32,7 +35,6 @@
 #endif
 
 #include "empathy-avatar-image.h"
-#include "empathy-contactinfo-utils.h"
 #include "empathy-groups-widget.h"
 #include "empathy-gtk-enum-types.h"
 #include "empathy-location.h"
@@ -296,13 +298,13 @@ details_update_show (EmpathyIndividualWidget *self,
   TpAccount *account;
 
   info = tp_contact_dup_contact_info (contact);
-  info = g_list_sort (info, (GCompareFunc) empathy_contact_info_field_cmp);
+  info = g_list_sort (info, (GCompareFunc) tpaw_contact_info_field_cmp);
   for (l = info; l != NULL; l = l->next)
     {
       TpContactInfoField *field = l->data;
       gchar *title;
       const gchar *value;
-      EmpathyContactInfoFormatFunc format;
+      TpawContactInfoFormatFunc format;
       GtkWidget *title_widget, *value_widget;
 
       if (field->field_value == NULL || field->field_value[0] == NULL)
@@ -310,7 +312,7 @@ details_update_show (EmpathyIndividualWidget *self,
 
       value = field->field_value[0];
 
-      if (!empathy_contact_info_lookup_field (field->field_name,
+      if (!tpaw_contact_info_lookup_field (field->field_name,
           NULL, &format))
         {
           DEBUG ("Unhandled ContactInfo field: %s", field->field_name);
@@ -322,7 +324,7 @@ details_update_show (EmpathyIndividualWidget *self,
         continue;
 
       /* Add Title */
-      title = empathy_contact_info_field_label (field->field_name,
+      title = tpaw_contact_info_field_label (field->field_name,
           field->parameters, TRUE);
       title_widget = gtk_label_new (title);
 
@@ -1293,21 +1295,21 @@ notify_presence_cb (gpointer folks_object,
       goto out;
     }
 
-  /* FIXME: Default messages should be moved into libfolks (bgo#627403) */
   message = folks_presence_details_get_presence_message (
       FOLKS_PRESENCE_DETAILS (folks_object));
-  if (EMP_STR_EMPTY (message))
+  if (TPAW_STR_EMPTY (message))
     {
-      message = empathy_presence_get_default_message (presence);
+      message = folks_presence_details_get_default_message_from_type (presence);
     }
 
   if (message != NULL)
-    markup_text = empathy_add_link_markup (message);
+    markup_text = tpaw_add_link_markup (message);
   gtk_label_set_markup (GTK_LABEL (status_label), markup_text);
   g_free (markup_text);
 
   gtk_image_set_from_icon_name (GTK_IMAGE (state_image),
-      empathy_icon_name_for_presence (presence),
+      empathy_icon_name_for_presence (
+        empathy_folks_presence_type_to_tp (presence)),
       GTK_ICON_SIZE_BUTTON);
 
 out:
@@ -1782,6 +1784,7 @@ personas_changed_cb (FolksIndividual *individual,
 
       g_clear_object (&persona);
     }
+  g_clear_object (&iter);
 
   /*
    * What we display for various conditions:
@@ -1847,6 +1850,7 @@ personas_changed_cb (FolksIndividual *individual,
           add_persona (self, persona);
           g_clear_object (&persona);
         }
+      g_clear_object (&iter);
     }
   else if (was_showing_personas && !will_show_personas)
     {
@@ -1858,6 +1862,7 @@ personas_changed_cb (FolksIndividual *individual,
           remove_persona (self, persona);
           g_clear_object (&persona);
         }
+      g_clear_object (&iter);
 
       if (removed != NULL)
         {
@@ -1876,7 +1881,6 @@ personas_changed_cb (FolksIndividual *individual,
       /* Set up the Individual grid instead */
       individual_grid_set_up (self);
     }
-  g_clear_object (&iter);
 
   /* Hide the last separator and show the others */
   children = gtk_container_get_children (GTK_CONTAINER (priv->vbox_individual));