[evolution-data-server] Correct OAuth2 mail accounts configured in GNOME Online Accounts



commit f887334e5102bcd2dd4c505266b7f29439bdca1d
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 22 15:57:27 2018 +0100

    Correct OAuth2 mail accounts configured in GNOME Online Accounts
    
    It broken in the previous OAuth2 change.

 po/POTFILES.in                 |    1 +
 src/camel/camel-sasl-xoauth2.c |   13 ++++++++++++-
 src/camel/camel-sasl.c         |    2 ++
 3 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0849028..f0e768f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -113,6 +113,7 @@ src/camel/camel-sasl-login.c
 src/camel/camel-sasl-ntlm.c
 src/camel/camel-sasl-plain.c
 src/camel/camel-sasl-popb4smtp.c
+src/camel/camel-sasl-xoauth2.c
 src/camel/camel-sasl-xoauth2-google.c
 src/camel/camel-search-private.c
 src/camel/camel-service.c
diff --git a/src/camel/camel-sasl-xoauth2.c b/src/camel/camel-sasl-xoauth2.c
index 627def4..08ceb0d 100644
--- a/src/camel/camel-sasl-xoauth2.c
+++ b/src/camel/camel-sasl-xoauth2.c
@@ -15,12 +15,22 @@
 
 #include "evolution-data-server-config.h"
 
+#include <glib/gi18n-lib.h>
+
 #include "camel-network-settings.h"
 #include "camel-session.h"
 
 #include "camel-sasl-xoauth2.h"
 
-G_DEFINE_ABSTRACT_TYPE (CamelSaslXOAuth2, camel_sasl_xoauth2, CAMEL_TYPE_SASL)
+static CamelServiceAuthType sasl_xoauth2_auth_type = {
+       N_("OAuth2"),
+       N_("This option will use an OAuth 2.0 "
+          "access token to connect to the server"),
+       "XOAUTH2",
+       FALSE
+};
+
+G_DEFINE_TYPE (CamelSaslXOAuth2, camel_sasl_xoauth2, CAMEL_TYPE_SASL)
 
 static void
 sasl_xoauth2_append_request (GByteArray *byte_array,
@@ -101,6 +111,7 @@ camel_sasl_xoauth2_class_init (CamelSaslXOAuth2Class *class)
        CamelSaslClass *sasl_class;
 
        sasl_class = CAMEL_SASL_CLASS (class);
+       sasl_class->auth_type = &sasl_xoauth2_auth_type;
        sasl_class->challenge_sync = sasl_xoauth2_challenge_sync;
 }
 
diff --git a/src/camel/camel-sasl.c b/src/camel/camel-sasl.c
index ac93713..c59e4ae 100644
--- a/src/camel/camel-sasl.c
+++ b/src/camel/camel-sasl.c
@@ -31,6 +31,7 @@
 #include "camel-sasl-ntlm.h"
 #include "camel-sasl-plain.h"
 #include "camel-sasl-popb4smtp.h"
+#include "camel-sasl-xoauth2.h"
 #include "camel-sasl-xoauth2-google.h"
 #include "camel-sasl.h"
 #include "camel-service.h"
@@ -130,6 +131,7 @@ sasl_build_class_table (void)
        g_type_ensure (CAMEL_TYPE_SASL_NTLM);
        g_type_ensure (CAMEL_TYPE_SASL_PLAIN);
        g_type_ensure (CAMEL_TYPE_SASL_POPB4SMTP);
+       g_type_ensure (CAMEL_TYPE_SASL_XOAUTH2);
        g_type_ensure (CAMEL_TYPE_SASL_XOAUTH2_GOOGLE);
 
        class_table = g_hash_table_new_full (


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]