]> git.0d.be Git - empathy.git/commitdiff
remove MC password migration code
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 17 Jul 2012 13:04:13 +0000 (15:04 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 17 Jul 2012 13:05:20 +0000 (15:05 +0200)
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

index 6a588a955f5418b4922711fd74a924a427eab54e..40cfdb472a14f5b66720e030a574b35c10e1c16f 100644 (file)
@@ -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