[evolution-ews/gnome-3-20] Bug 765209 - Correct server version set from string



commit f0a0ccf34379b27ae64f4b457fd87ec9a0f8a8d3
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 21 14:34:25 2016 +0200

    Bug 765209 - Correct server version set from string

 src/server/e-ews-connection.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 550bc10..3edee67 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -4207,15 +4207,19 @@ void
 e_ews_connection_set_server_version_from_string (EEwsConnection *cnc,
                                                 const gchar *version)
 {
-       if (g_strcmp0 (version, "Exchange2007") == 0)
+       if (!version)
+               cnc->priv->version = E_EWS_EXCHANGE_UNKNOWN;
+       else if (g_strcmp0 (version, "Exchange2007") == 0)
                cnc->priv->version = E_EWS_EXCHANGE_2007;
-       else if (g_strcmp0 (version, "Exchange2007_SP1") == 0)
+       else if (g_strcmp0 (version, "Exchange2007_SP1") == 0 ||
+                g_str_has_prefix (version, "Exchange2007"))
                cnc->priv->version = E_EWS_EXCHANGE_2007_SP1;
        else if (g_strcmp0 (version, "Exchange2010") == 0)
                cnc->priv->version = E_EWS_EXCHANGE_2010;
        else if (g_strcmp0 (version, "Exchange2010_SP1") == 0)
                cnc->priv->version = E_EWS_EXCHANGE_2010_SP1;
-       else if (g_strcmp0 (version, "Exchange2010_SP2") == 0)
+       else if (g_strcmp0 (version, "Exchange2010_SP2") == 0 ||
+                g_str_has_prefix (version, "Exchange2010"))
                cnc->priv->version = E_EWS_EXCHANGE_2010_SP2;
        else
                cnc->priv->version = E_EWS_EXCHANGE_FUTURE;


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