priv->aggregator = folks_individual_aggregator_new ();
g_signal_connect (priv->aggregator, "individuals-changed",
G_CALLBACK (aggregator_individuals_changed_cb), self);
+ folks_individual_aggregator_prepare (priv->aggregator, NULL, NULL);
}
EmpathyIndividualManager *
g_clear_error (&error);
}
+ /* Set the contact's persona */
+ empathy_contact_set_persona (contact, persona);
+
/* We can unref the contact now */
g_object_unref (contact);
+ g_object_unref (persona);
}
void
EmpathyIndividualManagerPriv *priv;
GHashTable* details;
TpAccount *account;
- GValue value = {0};
const gchar *store_id;
g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));
g_object_ref (contact);
DEBUG ("adding individual from contact %s (%s)",
- empathy_contact_get_id (contact), empathy_contact_get_name (contact));
+ empathy_contact_get_id (contact), empathy_contact_get_alias (contact));
account = empathy_contact_get_account (contact);
store_id = tp_proxy_get_object_path (TP_PROXY (account));
- details = g_hash_table_new (g_str_hash, g_str_equal);
- g_value_init (&value, G_TYPE_STRING);
- g_value_set_string (&value, empathy_contact_get_id (contact));
- g_hash_table_insert (details, "contact", &value);
+ details = tp_asv_new (
+ "contact", G_TYPE_STRING, empathy_contact_get_id (contact),
+ NULL);
folks_individual_aggregator_add_persona_from_details (
priv->aggregator, NULL, "telepathy", store_id, details,
g_hash_table_destroy (details);
}
+static void
+aggregator_remove_individual_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ FolksIndividualAggregator *aggregator = FOLKS_INDIVIDUAL_AGGREGATOR (source);
+ GError *error = NULL;
+
+ folks_individual_aggregator_remove_individual_finish (
+ aggregator, result, &error);
+ if (error != NULL)
+ {
+ g_warning ("failed to remove individual: %s", error->message);
+ g_clear_error (&error);
+ }
+}
+
/**
* Removes the inner contact from the server (and thus the Individual). Not
* meant for de-shelling inner personas from an Individual.
folks_individual_get_id (individual),
folks_individual_get_alias (individual));
- folks_individual_aggregator_remove_individual (priv->aggregator, individual);
+ folks_individual_aggregator_remove_individual (priv->aggregator, individual,
+ aggregator_remove_individual_cb, self);
+}
+
+static void
+groups_change_group_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ FolksGroups *groups = FOLKS_GROUPS (source);
+ GError *error = NULL;
+
+ folks_groups_change_group_finish (groups, result, &error);
+ if (error != NULL)
+ {
+ g_warning ("failed to change group: %s", error->message);
+ g_clear_error (&error);
+ }
}
static void
FolksIndividual *individual,
const gchar *group)
{
- folks_groups_change_group (FOLKS_GROUPS (individual), group, FALSE);
+ folks_groups_change_group (FOLKS_GROUPS (individual), group, FALSE,
+ groups_change_group_cb, NULL);
}
void