aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-05-13 01:47:16 +0800
committerMilan Crha <mcrha@redhat.com>2014-05-13 01:47:16 +0800
commitd46ad6d3cd44c3c9b730566cbd7719c2961a9bc9 (patch)
treebdc2d2362021b2da8b8b0eaab55ca28af61122ca /mail
parent4508696844c20530bdf7fe6150c432eb16a9c77b (diff)
downloadgsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar.gz
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar.bz2
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar.lz
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar.xz
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.tar.zst
gsoc2013-evolution-d46ad6d3cd44c3c9b730566cbd7719c2961a9bc9.zip
Bug #678843 - May re-prompt password on account re-enable
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-account-store.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index cfcbbc9caa..2a6439c1b1 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -481,6 +481,35 @@ mail_account_store_constructed (GObject *object)
}
static void
+mail_account_store_allow_auth_prompt_done_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GError *local_error = NULL;
+
+ e_source_allow_auth_prompt_finish (E_SOURCE (source_object), result, &local_error);
+
+ if (local_error) {
+ g_debug ("%s: Failed with: %s", G_STRFUNC, local_error->message);
+ g_clear_error (&local_error);
+ }
+}
+
+static void
+call_allow_auth_prompt (ESource *source)
+{
+ if (!source)
+ return;
+
+ g_return_if_fail (E_IS_SOURCE (source));
+
+ /* There is not much interest in the result, it just
+ makes sure a password prompt will be shown the next
+ time it is needed. */
+ e_source_allow_auth_prompt (source, NULL, mail_account_store_allow_auth_prompt_done_cb, NULL);
+}
+
+static void
mail_account_store_service_added (EMailAccountStore *store,
CamelService *service)
{
@@ -643,12 +672,16 @@ mail_account_store_service_disabled (EMailAccountStore *store,
ESourceMailAccount *extension;
const gchar *extension_name;
+ call_allow_auth_prompt (source);
+
extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
extension = e_source_get_extension (source, extension_name);
uid = e_source_mail_account_get_identity_uid (extension);
- if (uid != NULL)
+ if (uid != NULL) {
identity = e_source_registry_ref_source (registry, uid);
+ call_allow_auth_prompt (identity);
+ }
if (identity != NULL && e_source_get_writable (identity)) {
e_source_set_enabled (identity, FALSE);
@@ -675,6 +708,8 @@ mail_account_store_service_disabled (EMailAccountStore *store,
collection = e_source_registry_find_extension (
registry, source, E_SOURCE_EXTENSION_COLLECTION);
if (collection != NULL) {
+ call_allow_auth_prompt (collection);
+
g_object_unref (source);
source = collection;
}