diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-17 21:04:13 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-17 21:05:20 +0800 |
commit | 7e7732cf98ba9f60eb95a857178b82a8772cd403 (patch) | |
tree | 0a824be2258f4e87f054c6fcf1c10a2e114d4797 | |
parent | 8d706a1e765e6bc74ecf7b3855df3fd03b92f62c (diff) | |
download | gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar.gz gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar.bz2 gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar.lz gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar.xz gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.tar.zst gsoc2013-empathy-7e7732cf98ba9f60eb95a857178b82a8772cd403.zip |
remove MC password migration code
We are shipping this since a bunch of releases so all passwords should be
migrated since a while.
Furthemore, it may cause issues when the password has been updated in Empathy
but not MC.
https://bugzilla.gnome.org/show_bug.cgi?id=677180
-rw-r--r-- | libempathy/empathy-account-settings.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 6a588a955..40cfdb472 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -463,83 +463,11 @@ empathy_account_settings_get_password_cb (GObject *source, g_signal_emit (self, signals[PASSWORD_RETRIEVED], 0); } -static void -empathy_account_settings_migrate_password_cb (GObject *source, - GAsyncResult *result, - gpointer user_data) -{ - TpAccount *account = TP_ACCOUNT (source); - GError *error = NULL; - EmpathyAccountSettings *self = user_data; - EmpathyAccountSettingsPriv *priv = GET_PRIV (self); - GVariantBuilder *builder; - const gchar *unset[] = { "password", NULL }; - - if (!empathy_keyring_set_account_password_finish (account, result, &error)) - { - DEBUG ("Failed to set password: %s", error->message); - g_clear_error (&error); - return; - } - - /* Now clear the password MC has stored. */ - builder = g_variant_builder_new (G_VARIANT_TYPE_VARDICT); - - tp_account_update_parameters_vardict_async (priv->account, - g_variant_builder_end (builder), unset, NULL, NULL); - - g_hash_table_remove (priv->parameters, "password"); -} - static GVariant * empathy_account_settings_dup ( EmpathyAccountSettings *settings, const gchar *param); static void -empathy_account_settings_try_migrating_password (EmpathyAccountSettings *self) -{ - EmpathyAccountSettingsPriv *priv = GET_PRIV (self); - GVariant *v; - const gchar *password; - - v = empathy_account_settings_dup (self, "password"); - if (v == NULL) - return; - - if (!priv->supports_sasl) - goto out; - - /* mission-control still has our password, although the CM - * supports SASL. Let's try migrating it. */ - - DEBUG ("Trying to migrate password parameter from MC to the " - "keyring ourselves for account %s", - tp_account_get_path_suffix (priv->account)); - - /* I can't imagine why this would fail. */ - if (!g_variant_is_of_type (v, G_VARIANT_TYPE_STRING)) - goto out; - - password = g_variant_get_string (v, NULL); - - if (EMP_STR_EMPTY (password)) - goto out; - - empathy_keyring_set_account_password_async (priv->account, password, - empathy_account_settings_migrate_password_cb, self); - - /* We don't want to request the password again, we - * already know it. */ - priv->password_requested = TRUE; - - priv->password = g_strdup (password); - priv->password_original = g_strdup (password); - -out: - g_variant_unref (v); -} - -static void empathy_account_settings_check_readyness (EmpathyAccountSettings *self) { EmpathyAccountSettingsPriv *priv = GET_PRIV (self); @@ -624,10 +552,6 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) (GDestroyNotify) tp_connection_manager_param_free); } - /* NOTE: When removing MC migration code, remove this call, and the - * function it's calling. That's it. */ - empathy_account_settings_try_migrating_password (self); - /* priv->account won't be a proper account if it's the account * assistant showing this widget. */ if (priv->supports_sasl && !priv->password_requested |