*/
#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <telepathy-glib/account-manager.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/gtypes.h>
-
#include "empathy-account-settings.h"
+
#include "empathy-connection-managers.h"
#include "empathy-keyring.h"
-#include "empathy-utils.h"
#include "empathy-presence-manager.h"
+#include "empathy-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountSettings)
gboolean ready;
gboolean supports_sasl;
- gboolean password_changed;
+ gboolean remember_password;
gchar *password;
gchar *password_original;
{
g_free (priv->password);
priv->password = NULL;
- priv->password_changed = TRUE;
return;
}
g_hash_table_remove_all (priv->parameters);
empathy_account_settings_free_unset_parameters (settings);
- priv->password_changed = FALSE;
g_free (priv->password);
priv->password = g_strdup (priv->password_original);
{
g_free (priv->password);
priv->password = g_variant_dup_string (v, NULL);
- priv->password_changed = TRUE;
}
else
{
goto out;
}
- /* Only set the password in the keyring if the CM supports SASL and
- * it's changed. */
- if (priv->supports_sasl && priv->password_changed)
+ update_account_uri_schemes (settings);
+ update_account_service (settings);
+
+ g_simple_async_result_set_op_res_gboolean (priv->apply_result,
+ g_strv_length (reconnect_required) > 0);
+
+ /* Only set the password in the keyring if the CM supports SASL. */
+ if (priv->supports_sasl)
{
if (priv->password != NULL)
{
/* FIXME: we shouldn't save the password if we
* can't (MaySaveResponse=False) but we don't have API to check that
* at this point (fdo #35382). */
- empathy_keyring_set_account_password_async (priv->account, priv->password,
+ empathy_keyring_set_account_password_async (priv->account,
+ priv->password, priv->remember_password,
empathy_account_settings_set_password_cb, settings);
}
else
return;
}
- update_account_uri_schemes (settings);
- update_account_service (settings);
-
- g_simple_async_result_set_op_res_gboolean (priv->apply_result,
- g_strv_length (reconnect_required) > 0);
-
out:
empathy_account_settings_discard_changes (settings);
* can't (MaySaveResponse=False) but we don't have API to check that
* at this point (fdo #35382). */
empathy_keyring_set_account_password_async (priv->account,
- priv->password, empathy_account_settings_set_password_cb,
+ priv->password, priv->remember_password,
+ empathy_account_settings_set_password_cb,
settings);
return;
}
g_free (priv->storage_provider);
priv->storage_provider = g_strdup (storage);
}
+
+void
+empathy_account_settings_set_remember_password (EmpathyAccountSettings *self,
+ gboolean remember)
+{
+ EmpathyAccountSettingsPriv *priv = GET_PRIV (self);
+
+ priv->remember_password = remember;
+}