[empathy] Support contact removal



commit e54fe4814b321be3e32e99f7dfd49b93e392bded
Author: Travis Reitter <treitter gmail com>
Date:   Wed Jun 23 20:12:42 2010 -0700

    Support contact removal

 configure.ac                              |    2 +-
 libempathy-gtk/empathy-individual-store.c |   10 ++++++++--
 libempathy/empathy-individual-manager.c   |   18 ++++++++++++++++--
 3 files changed, 25 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 17e0f57..570c5c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ AC_COPYRIGHT([
 # Minimal version required
 
 # Hardp deps
-FOLKS_REQUIRED=0.1.2
+FOLKS_REQUIRED=0.1.3
 GCONF_REQUIRED=1.2.0
 GLIB_REQUIRED=2.25.9
 GTK_REQUIRED=2.21.2
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 976053c..a1a07a3 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -353,6 +353,9 @@ individual_store_add_individual (EmpathyIndividualStore *self,
   GtkTreeIter iter;
   GHashTable *group_set = NULL;
   GList *groups = NULL, *l;
+  EmpathyIndividualManager *manager;
+  EmpathyContact *contact;
+  TpConnection *connection;
   EmpathyIndividualManagerFlags flags = 0;
 
   priv = GET_PRIV (self);
@@ -369,8 +372,11 @@ individual_store_add_individual (EmpathyIndividualStore *self,
       groups = g_hash_table_get_keys (group_set);
     }
 
-  /* TODO: implement */
-  DEBUG ("group capability flags not implemented");
+  manager = empathy_individual_manager_dup_singleton ();
+  contact = empathy_contact_from_folks_individual (individual);
+  connection = empathy_contact_get_connection (contact);
+  flags = empathy_individual_manager_get_flags_for_connection (manager,
+      connection);
 
   if (!groups)
     {
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index fe8ccad..53843ce 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -310,13 +310,27 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
   g_hash_table_destroy (details);
 }
 
+/**
+ * Removes the inner contact from the server (and thus the Individual). Not
+ * meant for de-shelling inner personas from an Individual.
+ */
 void
 empathy_individual_manager_remove (EmpathyIndividualManager *self,
     FolksIndividual *individual,
     const gchar *message)
 {
-  /* TODO: implement */
-  DEBUG (G_STRLOC ": individual removal not implemented");
+  EmpathyIndividualManagerPriv *priv;
+
+  g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));
+  g_return_if_fail (FOLKS_IS_INDIVIDUAL (individual));
+
+  priv = GET_PRIV (self);
+
+  DEBUG (G_STRLOC ": removing individual %s (%s)",
+      folks_individual_get_id (individual),
+      folks_individual_get_alias (individual));
+
+  folks_individual_aggregator_remove_individual (priv->aggregator, individual);
 }
 
 EmpathyIndividualManagerFlags



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]