Modified webpage: now tinymail repository is in gitorious.
[modest] / tests / dbus_api / test_open_account.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3
4 int
5 main (int argc, char *argv[])
6 {
7         osso_context_t *osso_context;
8         const char *url = NULL;
9         gboolean ret;
10
11         osso_context = osso_initialize ("test_open_account",
12                                         "0.0.1",
13                                         TRUE,
14                                         NULL);
15
16         if (osso_context == NULL) {
17                 g_printerr ("osso_initialize() failed.\n");
18             return -1;
19         }
20
21         if (argc == 2) {
22                 url = argv[1];
23         } else {
24                 g_printerr ("No account ID argument supplied on the command line.\n");
25                 return -1;
26         }
27
28         g_print ("Trying to open msg: %s\n", url);
29         ret = libmodest_dbus_client_open_account (osso_context, url);
30
31         if (!ret) {
32                 g_printerr ("libmodest_dbus_client_open_account () failed.\n");
33         } else {
34                 g_print ("libmodest_dbus_client_open_account () succeeded.\n");
35         }
36
37     return ret ? 0 : -1;
38 }