[evolution-data-server] Bug 746346 - [IMAPx] Propagate no-password authentication errors into UI
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 746346 - [IMAPx] Propagate no-password authentication errors into UI
- Date: Tue, 31 Mar 2015 15:08:05 +0000 (UTC)
commit 1228dde09c6d85dc684bdb3a2e202f5f3c06b6f7
Author: Milan Crha <mcrha redhat com>
Date: Tue Mar 31 17:07:47 2015 +0200
Bug 746346 - [IMAPx] Propagate no-password authentication errors into UI
camel/providers/imapx/camel-imapx-server.c | 13 +++++++++++++
camel/providers/imapx/camel-imapx-utils.c | 4 ++++
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index b53a9e5..6620ee2 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4868,6 +4868,19 @@ camel_imapx_server_authenticate (CamelIMAPXServer *is,
CAMEL_IMAPX_SERVER_ERROR_CONCURRENT_CONNECT_FAILED,
ic->status->text ? ic->status->text : _("Unknown error"));
result = CAMEL_AUTHENTICATION_ERROR;
+ } else if (sasl) {
+ CamelSaslClass *sasl_class;
+
+ sasl_class = CAMEL_SASL_GET_CLASS (sasl);
+ if (sasl_class && sasl_class->auth_type && !sasl_class->auth_type->need_password) {
+ g_set_error_literal (
+ error, CAMEL_SERVICE_ERROR,
+ CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+ ic->status->text ? ic->status->text : _("Unknown error"));
+ result = CAMEL_AUTHENTICATION_ERROR;
+ } else {
+ result = CAMEL_AUTHENTICATION_REJECTED;
+ }
} else {
result = CAMEL_AUTHENTICATION_REJECTED;
}
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index 07e7901..71679ed 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -2500,6 +2500,10 @@ imapx_parse_status (CamelIMAPXInputStream *stream,
if (!success)
goto fail;
+ if (sinfo->text) {
+ g_strstrip (sinfo->text);
+ }
+
goto exit;
fail:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]