static void account_prepare_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (user_data); TpAccount *account = TP_ACCOUNT (source_object); GError *error = NULL; if (!tp_account_prepare_finish (account, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); account = NULL; } empathy_accounts_show_accounts_ui (manager, account, G_CALLBACK (gtk_main_quit)); }
static void remmina_tp_channel_handler_account_ready(GObject *account, GAsyncResult *res, gpointer user_data) { RemminaTpChannelHandler *chandler = (RemminaTpChannelHandler *) user_data; GError *error = NULL; if (!tp_account_prepare_finish(TP_ACCOUNT(account), res, &error)) { g_print("tp_account_prepare_finish: %s\n", error->message); remmina_tp_channel_handler_free(chandler); return; } chandler->connection = tp_connection_new(chandler->bus, NULL, chandler->connection_path, &error); if (chandler->connection == NULL) { g_print("tp_connection_new: %s\n", error->message); remmina_tp_channel_handler_free(chandler); return; } tp_connection_call_when_ready(chandler->connection, remmina_tp_channel_handler_connection_ready, chandler); }