5 #include <libempathy/empathy-contact-factory.h>
6 #include <libmissioncontrol/mc-account.h>
9 callback (gpointer data)
11 EmpathyContactFactory *factory;
13 EmpathyContact *contact;
14 EmpathyContactReady ready_flags;
16 factory = empathy_contact_factory_dup_singleton ();
17 account = mc_account_lookup ("jabber0");
18 contact = empathy_contact_factory_get_from_handle (factory, account, 2);
20 g_print ("Contact handle=%d alias=%s\n",
21 empathy_contact_get_handle (contact),
22 empathy_contact_get_name (contact));
24 ready_flags = EMPATHY_CONTACT_READY_HANDLE | EMPATHY_CONTACT_READY_NAME;
25 empathy_contact_run_until_ready (contact, ready_flags, NULL);
27 g_print ("Contact ready: handle=%d alias=%s ready=%d needed-ready=%d\n",
28 empathy_contact_get_handle (contact),
29 empathy_contact_get_name (contact),
30 empathy_contact_get_ready (contact),
33 g_object_unref (factory);
34 g_object_unref (account);
35 g_object_unref (contact);
43 main (int argc, char **argv)
45 gtk_init (&argc, &argv);
47 g_idle_add (callback, NULL);