#include <libmissioncontrol/mc-account.h>
#include <libmissioncontrol/mission-control.h>
+#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/gossip-debug.h>
#include <libempathy/gossip-utils.h>
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_CONTACT_LIST, GossipContactListPriv))
struct _GossipContactListPriv {
- EmpathyContactManager *manager;
+ EmpathyContactList *list;
GHashTable *groups;
gpointer data);
static void contact_list_contact_update (GossipContactList *list,
GossipContact *contact);
-static void contact_list_contact_added_cb (EmpathyContactManager *manager,
+static void contact_list_contact_added_cb (EmpathyContactList *list_iface,
GossipContact *contact,
GossipContactList *list);
static void contact_list_contact_updated_cb (GossipContact *contact,
static void contact_list_contact_groups_updated_cb (GossipContact *contact,
GParamSpec *param,
GossipContactList *list);
-static void contact_list_contact_removed_cb (EmpathyContactManager *manager,
+static void contact_list_contact_removed_cb (EmpathyContactList *list_iface,
GossipContact *contact,
GossipContactList *list);
static void contact_list_contact_set_active (GossipContactList *list,
priv = GET_PRIV (list);
- priv->manager = empathy_contact_manager_new ();
+ priv->list = EMPATHY_CONTACT_LIST (empathy_contact_manager_new ());
priv->is_compact = FALSE;
priv->show_active = TRUE;
priv->show_avatars = TRUE;
contact_list_create_model (list);
contact_list_setup_view (list);
- empathy_contact_manager_setup (priv->manager);
+ empathy_contact_list_setup (priv->list);
/* Get saved group states. */
gossip_contact_groups_get_all ();
NULL, NULL);
/* Signal connection. */
- g_signal_connect (priv->manager,
+ g_signal_connect (priv->list,
"contact-added",
G_CALLBACK (contact_list_contact_added_cb),
list);
- g_signal_connect (priv->manager,
+ g_signal_connect (priv->list,
"contact-removed",
G_CALLBACK (contact_list_contact_removed_cb),
list);
GINT_TO_POINTER (FALSE));
/* Add contacts already created */
- contacts = empathy_contact_manager_get_contacts (priv->manager);
+ contacts = empathy_contact_list_get_contacts (priv->list);
for (l = contacts; l; l = l->next) {
GossipContact *contact;
contact = l->data;
- contact_list_contact_added_cb (priv->manager, contact, list);
+ contact_list_contact_added_cb (priv->list, contact, list);
g_object_unref (contact);
}
priv = GET_PRIV (object);
- /* FIXME: disconnect all signals on the manager and contacts */
+ /* FIXME: disconnect all signals on the list and contacts */
- g_object_unref (priv->manager);
+ g_object_unref (priv->list);
g_object_unref (priv->ui);
g_object_unref (priv->store);
g_object_unref (priv->filter);
}
static void
-contact_list_contact_added_cb (EmpathyContactManager *manager,
- GossipContact *contact,
- GossipContactList *list)
+contact_list_contact_added_cb (EmpathyContactList *list_iface,
+ GossipContact *contact,
+ GossipContactList *list)
{
GossipContactListPriv *priv;
}
static void
-contact_list_contact_removed_cb (EmpathyContactManager *manager,
- GossipContact *contact,
- GossipContactList *list)
+contact_list_contact_removed_cb (EmpathyContactList *list_iface,
+ GossipContact *contact,
+ GossipContactList *list)
{
gossip_debug (DEBUG_DOMAIN, "Contact:'%s' removed",
gossip_contact_get_name (contact));
id);
/* FIXME: This is ambigous, an id can come from multiple accounts */
- contact = empathy_contact_manager_find (priv->manager, id);
+ contact = empathy_contact_list_find (priv->list, id);
if (!contact) {
gossip_debug (DEBUG_DOMAIN, "No contact found associated with drag & drop");
return;
* group should be shown because a contact we want to
* show exists in it.
*/
- contacts = empathy_contact_manager_get_contacts (priv->manager);
+ contacts = empathy_contact_list_get_contacts (priv->list);
for (l = contacts; l && !show_group; l = l->next) {
if (!gossip_contact_is_in_group (l->data, group)) {
continue;
/* Disable temporarily. */
priv->show_active = FALSE;
- contacts = empathy_contact_manager_get_contacts (priv->manager);
+ contacts = empathy_contact_list_get_contacts (priv->list);
for (l = contacts; l; l = l->next) {
GossipContact *contact;