From 9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 4 Mar 2009 11:41:28 +0100 Subject: Change EmpathyTpContactFactory API to look more like TpConnection. Add function to get only one contact from id/handle. --- megaphone/src/megaphone-applet.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'megaphone') diff --git a/megaphone/src/megaphone-applet.c b/megaphone/src/megaphone-applet.c index 48b5a1859..b58255fc2 100644 --- a/megaphone/src/megaphone-applet.c +++ b/megaphone/src/megaphone-applet.c @@ -172,13 +172,19 @@ megaphone_applet_update_contact (MegaphoneApplet *applet) static void megaphone_applet_got_contact_cb (EmpathyTpContactFactory *factory, - GList *contacts, + EmpathyContact *contact, + const GError *error, gpointer user_data, GObject *applet) { MegaphoneAppletPriv *priv = GET_PRIV (applet); - priv->contact = g_object_ref (contacts->data); + if (error != NULL) { + DEBUG ("Error: %s", error->message); + return; + } + + priv->contact = g_object_ref (contact); g_signal_connect_swapped (priv->contact, "notify", G_CALLBACK (megaphone_applet_update_contact), applet); @@ -192,14 +198,13 @@ megaphone_applet_new_connection_cb (EmpathyAccountManager *manager, MegaphoneApplet *applet) { MegaphoneAppletPriv *priv = GET_PRIV (applet); - const gchar *id = priv->id; if (priv->contact || !empathy_account_equal (account, priv->account)) { return; } priv->factory = empathy_tp_contact_factory_dup_singleton (connection); - empathy_tp_contact_factory_get_from_ids (priv->factory, 1, &id, + empathy_tp_contact_factory_get_from_id (priv->factory, priv->id, megaphone_applet_got_contact_cb, NULL, NULL, G_OBJECT (applet)); } -- cgit v1.2.3