if (group)
{
- if (enabled)
- {
- empathy_contact_list_remove_from_group (
- EMPATHY_CONTACT_LIST (information->manager), information->contact,
- group);
- }
- else
+ FolksIndividual *individual = folks_individual_from_empathy_contact (
+ information->contact);
+
+ if (individual)
{
- empathy_contact_list_add_to_group (
- EMPATHY_CONTACT_LIST (information->manager), information->contact,
- group);
+ folks_groups_change_group (FOLKS_GROUPS (individual), group, !enabled);
+ g_object_unref (individual);
}
+
g_free (group);
}
}
GtkTreeView *view;
GtkListStore *store;
GtkTreeIter iter;
+ FolksIndividual *individual;
const gchar *group;
view = GTK_TREE_VIEW (information->treeview_groups);
COL_ENABLED, TRUE,
-1);
- empathy_contact_list_add_to_group (
- EMPATHY_CONTACT_LIST (information->manager), information->contact,
- group);
+ individual = folks_individual_from_empathy_contact (information->contact);
+
+ if (individual)
+ {
+ folks_groups_change_group (FOLKS_GROUPS (individual), group, TRUE);
+ g_object_unref (individual);
+ }
}
static void
#include "empathy-utils.h"
#include "empathy-contact-manager.h"
+#include "empathy-individual-manager.h"
#include "empathy-dispatcher.h"
#include "empathy-dispatch-operation.h"
#include "empathy-idle.h"
return contact;
}
+
+/* TODO: This also needs to be eliminated, and is horrifically slow. */
+FolksIndividual *
+folks_individual_from_empathy_contact (EmpathyContact *contact)
+{
+ EmpathyIndividualManager *manager;
+ FolksIndividual *individual = NULL;
+ GList *individuals, *l;
+
+ manager = empathy_individual_manager_dup_singleton ();
+ individuals = empathy_individual_manager_get_members (manager);
+
+ for (l = individuals; (l != NULL) && (individual == NULL); l = l->next)
+ {
+ FolksIndividual *i = FOLKS_INDIVIDUAL (l->data);
+ EmpathyContact *c = empathy_contact_from_folks_individual (i);
+
+ if (c == contact)
+ individual = g_object_ref (i);
+
+ g_object_unref (c);
+ }
+
+ g_list_free (individuals);
+ g_object_unref (manager);
+
+ return individual;
+}
TpConnectionPresenceType empathy_folks_presence_type_to_tp (FolksPresenceType type);
gboolean empathy_folks_individual_contains_contact (FolksIndividual *individual);
EmpathyContact * empathy_contact_from_folks_individual (FolksIndividual *individual);
+FolksIndividual *folks_individual_from_empathy_contact (EmpathyContact *contact);
G_END_DECLS