]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-utils.c
Re-implement the context menu for Individuals
[empathy.git] / libempathy / empathy-utils.c
index 56da323b92b0a84a73fbdd7236524a4814f48c24..df2a41abdf6698c2905f866b37f77986f1773f93 100644 (file)
@@ -569,6 +569,30 @@ empathy_folks_presence_type_to_tp (FolksPresenceType type)
   return (TpConnectionPresenceType) type;
 }
 
+gboolean
+empathy_folks_individual_contains_contact (FolksIndividual *individual)
+{
+  GList *personas, *l;
+
+  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), FALSE);
+
+  personas = folks_individual_get_personas (individual);
+  for (l = personas; l != NULL; l = l->next)
+    {
+      TpfPersona *persona = l->data;
+
+      if (TPF_IS_PERSONA (persona))
+        {
+          TpContact *contact = tpf_persona_get_contact (persona);
+
+          if (TP_IS_CONTACT (contact))
+            return TRUE;
+        }
+    }
+
+  return FALSE;
+}
+
 EmpathyContact *
 empathy_contact_from_folks_individual (FolksIndividual *individual)
 {