diff options
author | Milan Crha <mcrha@redhat.com> | 2014-06-10 23:41:25 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-06-10 23:43:04 +0800 |
commit | 25a66ff7f4610649e684b9395601ce092d72df97 (patch) | |
tree | f51d9c1611bd7f591160c10929ce8a808c0bffa9 | |
parent | 9c7bc3fb7be052783b6b84e3efd01b112ef2018c (diff) | |
download | gsoc2013-evolution-25a66ff7f4610649e684b9395601ce092d72df97.tar.gz gsoc2013-evolution-25a66ff7f4610649e684b9395601ce092d72df97.tar.zst gsoc2013-evolution-25a66ff7f4610649e684b9395601ce092d72df97.zip |
Bug 678843 - May re-prompt password on message send
Follow-up fix, forgotten place to re-enable password prompt when
sending message.
-rw-r--r-- | libemail-engine/e-mail-session-utils.c | 20 | ||||
-rw-r--r-- | libemail-engine/mail-ops.c | 26 |
2 files changed, 43 insertions, 3 deletions
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c index 524b09d771..cd5dd50c52 100644 --- a/libemail-engine/e-mail-session-utils.c +++ b/libemail-engine/e-mail-session-utils.c @@ -542,6 +542,26 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, status = camel_service_get_connection_status (context->transport); if (status != CAMEL_SERVICE_CONNECTED) { + EMailSession *session; + ESourceRegistry *registry; + ESource *source; + + /* Make sure user will be asked for a password, in case he/she cancelled it */ + session = E_MAIL_SESSION (camel_service_ref_session (context->transport)); + registry = e_mail_session_get_registry (session); + source = e_source_registry_ref_source (registry, camel_service_get_uid (context->transport)); + g_object_unref (session); + + if (source) { + e_source_allow_auth_prompt_sync (source, cancellable, &error); + g_object_unref (source); + + if (error) { + g_simple_async_result_take_error (simple, error); + return; + } + } + did_connect = TRUE; camel_service_connect_sync ( diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index 81ed9a32e6..67fc5a9742 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -645,10 +645,30 @@ mail_send_message (struct _send_queue_msg *m, /* silently ignore */ goto exit; } + if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTED) { + EMailSession *session; + ESourceRegistry *registry; + ESource *source; + + /* Make sure user will be asked for a password, in case he/she cancelled it */ + session = E_MAIL_SESSION (camel_service_ref_session (service)); + registry = e_mail_session_get_registry (session); + source = e_source_registry_ref_source (registry, camel_service_get_uid (service)); + g_object_unref (session); + + if (source) { + gboolean success; - if (!camel_service_connect_sync ( - service, cancellable, error)) - goto exit; + success = e_source_allow_auth_prompt_sync (source, cancellable, error); + g_object_unref (source); + + if (!success) + goto exit; + } + + if (!camel_service_connect_sync (service, cancellable, error)) + goto exit; + } /* expand, or remove empty, group addresses */ em_utils_expand_groups (CAMEL_INTERNET_ADDRESS (recipients)); |