]> git.0d.be Git - empathy.git/blob - tests/contact-run-until-ready.c
Fix includes
[empathy.git] / tests / contact-run-until-ready.c
1 #include <stdlib.h>
2
3 #include <glib.h>
4 #include <libempathy/empathy-contact-factory.h>
5 #include <libmissioncontrol/mc-account.h>
6
7 int
8 main (int argc, char **argv)
9 {
10         EmpathyContactFactory *factory;
11         McAccount             *account;
12         EmpathyContact        *contact;
13         EmpathyContactReady    ready_flags;
14
15         g_type_init ();
16
17         factory = empathy_contact_factory_new ();
18         account = mc_account_lookup ("jabber4");
19         contact = empathy_contact_factory_get_from_id (factory, account,
20                                                        "testman@jabber.belnet.be");
21
22         g_print ("Contact handle=%d alias=%s\n",
23                  empathy_contact_get_handle (contact),
24                  empathy_contact_get_name (contact));
25
26         ready_flags = EMPATHY_CONTACT_READY_HANDLE | EMPATHY_CONTACT_READY_NAME;
27         empathy_contact_run_until_ready (contact, ready_flags, NULL);
28
29         g_print ("Contact ready: handle=%d alias=%s ready=%d needed-ready=%d\n",
30                  empathy_contact_get_handle (contact),
31                  empathy_contact_get_name (contact),
32                  empathy_contact_get_ready (contact),
33                  ready_flags);
34
35         g_object_unref (factory);
36         g_object_unref (account);
37         g_object_unref (contact);
38
39         return EXIT_SUCCESS;
40 }
41