manager = empathy_individual_manager_dup_singleton ();
list = EMPATHY_INDIVIDUAL_MANAGER (manager);
- if (gtk_check_menu_item_get_active (item))
- empathy_individual_manager_add_to_favourites (list, individual);
- else
- empathy_individual_manager_remove_from_favourites (list, individual);
+ folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual),
+ gtk_check_menu_item_get_active (item));
g_object_unref (manager);
}
manager = empathy_individual_manager_dup_singleton ();
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
- empathy_individual_manager_is_favourite (
- EMPATHY_INDIVIDUAL_MANAGER (manager), individual));
+ folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)));
g_signal_connect (item, "toggled",
G_CALLBACK (favourite_menu_item_toggled_cb), individual);
if (group_set != NULL)
g_hash_table_unref (group_set);
-#ifdef HAVE_FAVOURITE_CONTACTS
if (priv->show_groups &&
- empathy_individual_manager_is_favourite (priv->manager, individual))
+ folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)))
{
/* Add contact to the fake 'Favorites' group */
GtkTreeIter iter_group;
add_individual_to_store (GTK_TREE_STORE (self), &iter, &iter_group,
individual, flags);
}
-#endif
individual_store_contact_update (self, individual);
}
if (!tp_strdiff (new_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
{
/* Mark contact as favourite */
+ folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), TRUE);
/* TODO: implement this */
DEBUG ("adding individual to favourites not fully implemented");
if (!tp_strdiff (old_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
{
/* Remove contact as favourite */
+ folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), FALSE);
/* TODO: implement this */
DEBUG ("removing individual from favourites not fully " "implemented");
FolksIndividualAggregator *aggregator;
EmpathyContactManager *contact_manager;
TpProxy *logger;
- /* account object path (gchar *) => GHashTable containing favorite contacts
- * (contact ID (gchar *) => TRUE) */
- GHashTable *favourites;
- TpProxySignalConnection *favourite_contacts_changed_signal;
} EmpathyIndividualManagerPriv;
G_DEFINE_TYPE (EmpathyIndividualManager, empathy_individual_manager,
{
EmpathyIndividualManagerPriv *priv = GET_PRIV (object);
- tp_proxy_signal_connection_disconnect (
- priv->favourite_contacts_changed_signal);
-
if (priv->logger != NULL)
g_object_unref (priv->logger);
if (priv->aggregator != NULL)
g_object_unref (priv->aggregator);
-
- g_hash_table_destroy (priv->favourites);
}
static GObject *
self->priv = priv;
priv->contact_manager = empathy_contact_manager_dup_singleton ();
- priv->favourites = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify) g_free, (GDestroyNotify) g_hash_table_unref);
-
priv->aggregator = folks_individual_aggregator_new ();
- if (error == NULL)
- {
- g_signal_connect (priv->aggregator, "individuals-added",
- G_CALLBACK (aggregator_individuals_added_cb), self);
- g_signal_connect (priv->aggregator, "individuals-removed",
- G_CALLBACK (aggregator_individuals_removed_cb), self);
- }
- else
- {
- DEBUG ("Failed to get individual aggregator: %s", error->message);
- g_clear_error (&error);
- }
+ g_signal_connect (priv->aggregator, "individuals-added",
+ G_CALLBACK (aggregator_individuals_added_cb), self);
+ g_signal_connect (priv->aggregator, "individuals-removed",
+ G_CALLBACK (aggregator_individuals_removed_cb), self);
bus = tp_dbus_daemon_dup (&error);
FolksIndividual *individual,
const gchar *message);
-gboolean empathy_individual_manager_is_favourite (
- EmpathyIndividualManager *manager,
- FolksIndividual *individual);
-
EmpathyIndividualManagerFlags
empathy_individual_manager_get_flags_for_connection (
EmpathyIndividualManager *manager,