]> git.0d.be Git - empathy.git/commitdiff
libempathy: Remove empathy_create_individual_from_tp_contact()
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 21 Nov 2013 18:09:16 +0000 (18:09 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 25 Nov 2013 10:51:53 +0000 (10:51 +0000)
It has been replaced by empathy_ensure_individual_from_tp_contact(),
which can’t cause internal state corruption in libfolks by wrapping an
existing Persona in a second Individual when it’s already wrapped in
one.

This has also been fixed in libfolks.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1031252

https://bugzilla.gnome.org/show_bug.cgi?id=712839

libempathy-gtk/empathy-contact-chooser.c
libempathy-gtk/empathy-individual-menu.c
libempathy-gtk/empathy-individual-store-channel.c
libempathy/empathy-utils.c
libempathy/empathy-utils.h

index e31b22fe11cc5e9d8b98975c4d43955426a4a051..b82aa93a11e7a97acc234423c4fff3f27e1ba74f 100644 (file)
@@ -232,7 +232,7 @@ get_contacts_cb (GObject *source,
     /* another request has been started */
     goto out;
 
-  individual =  empathy_create_individual_from_tp_contact (contact);
+  individual =  empathy_ensure_individual_from_tp_contact (contact);
   if (individual == NULL)
     goto out;
 
index b7b0abe8655adf92203ef2195bbf3a651af1462f..7f53a7a83d3d2af5af69ede4408abecde4096152 100644 (file)
@@ -164,7 +164,7 @@ individual_menu_add_personas (EmpathyIndividualMenu *self,
         goto while_finish;
 
       contact = empathy_contact_dup_from_tp_contact (tp_contact);
-      single_individual = empathy_create_individual_from_tp_contact (
+      single_individual = empathy_ensure_individual_from_tp_contact (
           tp_contact);
 
       /* Pretty hacky. Creating single_individual had a side effect to change
index 4064da054d17b89d6849ca729ee8a4f240926f53..a18bc33de3e72b0da26d3683af87f753f2c1bad6 100644 (file)
@@ -70,7 +70,7 @@ add_members (EmpathyIndividualStoreChannel *self,
       if (g_hash_table_lookup (self->priv->individuals, contact) != NULL)
         continue;
 
-      individual = empathy_create_individual_from_tp_contact (contact);
+      individual = empathy_ensure_individual_from_tp_contact (contact);
       if (individual == NULL)
         return;
 
index 4555d414493a53b49d302229fbc14bb84167a4dc..9ee9606cce24ba2172769860ed65a23e37c09970 100644 (file)
@@ -946,26 +946,6 @@ create_individual_from_persona (FolksPersona *persona)
   return individual;
 }
 
-FolksIndividual *
-empathy_create_individual_from_tp_contact (TpContact *contact)
-{
-  TpfPersona *persona;
-  FolksIndividual *individual;
-
-  persona = tpf_persona_dup_for_contact (contact);
-  if (persona == NULL)
-    {
-      DEBUG ("Failed to get a persona for %s",
-          tp_contact_get_identifier (contact));
-      return NULL;
-    }
-
-  individual = create_individual_from_persona (FOLKS_PERSONA (persona));
-
-  g_object_unref (persona);
-  return individual;
-}
-
 /* Look for a FolksIndividual containing @contact as one of his persona
  * and create one if needed */
 FolksIndividual *
index 40291b971cfea3038acee3b2a366a0184ed2f661..a9ff0d89060df76b63fc7d0471a1ba90e95082f7 100644 (file)
@@ -102,9 +102,6 @@ void empathy_individual_can_audio_video_call (FolksIndividual *individual,
 gboolean empathy_client_types_contains_mobile_device (
     const GStrv types);
 
-FolksIndividual * empathy_create_individual_from_tp_contact (
-    TpContact *contact);
-
 FolksIndividual * empathy_ensure_individual_from_tp_contact (
     TpContact *contact);