From 7e7732cf98ba9f60eb95a857178b82a8772cd403 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 17 Jul 2012 15:04:13 +0200 Subject: 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 --- libempathy/empathy-account-settings.c | 76 ----------------------------------- 1 file changed, 76 deletions(-) (limited to 'libempathy') 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,82 +463,10 @@ 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) { @@ -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 -- cgit v1.2.3