summaryrefslogtreecommitdiff
path: root/ubuntu-online-accounts
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-18 15:44:31 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-24 16:37:23 +0200
commit05661398f75603bf09a8e7042a3ba8e056a9217f (patch)
tree1ae713fb14f4dedf791fcfba2d2213aa1cd098d7 /ubuntu-online-accounts
parent3d004d7ebe17b0a139ef38cbd4e5631940210b78 (diff)
account-plugins: implement delete
https://bugzilla.gnome.org/show_bug.cgi?id=680448
Diffstat (limited to 'ubuntu-online-accounts')
-rw-r--r--ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin.c b/ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin.c
index cbbe90b3e..858ef65e1 100644
--- a/ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin.c
+++ b/ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin.c
@@ -47,11 +47,39 @@ empathy_accounts_plugin_build_widget (ApPlugin *plugin)
}
static void
+store_delete_cb (AgAccount *account,
+ const GError *error,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result = user_data;
+
+ if (error != NULL)
+ {
+ g_debug ("Failed to delete account with ID '%u': %s",
+ account->id, error->message);
+
+ g_simple_async_result_set_from_error (result, error);
+ }
+
+ g_simple_async_result_complete (result);
+ g_object_unref (result);
+}
+
+static void
empathy_accounts_plugin_delete_account (ApPlugin *plugin,
GAsyncReadyCallback callback,
gpointer user_data)
{
- /* TODO */
+ AgAccount *account;
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new (G_OBJECT (plugin),
+ callback, user_data, ap_plugin_delete_account);
+
+ account = ap_plugin_get_account (plugin);
+
+ ag_account_delete (account);
+ ag_account_store (account, store_delete_cb, result);
}
static void