diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-08-28 16:19:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-08-28 16:38:17 +0800 |
commit | c020298d0898da9f6ba17ab5e1dd3bdd68b74b2c (patch) | |
tree | 06fbe4609879bdb87f591de3e84c6d39b90573f5 /src | |
parent | 2f87cddf8c0bec795fa06cc4ce5f15e5c755748a (diff) | |
download | gsoc2013-empathy-c020298d0898da9f6ba17ab5e1dd3bdd68b74b2c.tar.gz gsoc2013-empathy-c020298d0898da9f6ba17ab5e1dd3bdd68b74b2c.tar.zst gsoc2013-empathy-c020298d0898da9f6ba17ab5e1dd3bdd68b74b2c.zip |
uoa-migration: delete account if plugin is missing
Best to have to re-create an account than having a ghost account staying
around.
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-sanity-cleaning.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c index 9c9d83c2b..326b64671 100644 --- a/src/empathy-sanity-cleaning.c +++ b/src/empathy-sanity-cleaning.c @@ -431,6 +431,24 @@ migrate_account_to_uoa (TpAccountManager *am, } static void +uoa_account_remove_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + TpAccount *account = TP_ACCOUNT (source); + GError *error = NULL; + + if (!tp_account_remove_finish (account, result, &error)) + { + DEBUG ("Failed to remove account '%s': %s", + tp_account_get_path_suffix (account), error->message); + g_error_free (error); + } + + g_object_set_data (G_OBJECT (account), DATA_SANITY_CTX, NULL); +} + +static void uoa_plugin_install_cb (GObject *source, GAsyncResult *result, gpointer user_data) @@ -441,10 +459,12 @@ uoa_plugin_install_cb (GObject *source, if (!empathy_pkg_kit_install_packages_finish (result, &error)) { - DEBUG ("Failed to install plugin: %s", error->message); + DEBUG ("Failed to install plugin for account '%s' (%s); remove it", + tp_account_get_path_suffix (account), error->message); + g_error_free (error); - g_object_set_data (G_OBJECT (account), DATA_SANITY_CTX, NULL); + tp_account_remove_async (account, uoa_account_remove_cb, NULL); goto out; } |