Hello community,

here is the log from the commit of package evolution-ews for openSUSE:Factory 
checked in at 2016-05-16 12:01:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/evolution-ews (Old)
 and      /work/SRC/openSUSE:Factory/.evolution-ews.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "evolution-ews"

Changes:
--------
--- /work/SRC/openSUSE:Factory/evolution-ews/evolution-ews.changes      
2016-04-28 16:51:47.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.evolution-ews.new/evolution-ews.changes 
2016-05-16 12:01:54.000000000 +0200
@@ -1,0 +2,8 @@
+Tue May 10 17:21:05 UTC 2016 - [email protected]
+
+- Update to version 3.20.2:
+  + Ask for password after NTLM/SSO authentication failure.
+  + Bugs fixed: bgo#764976, bgo#765209, bgo#765398.
+- Drop evolution-ews-ntlm-auth-test-failure.patch: Fixed upstream.
+
+-------------------------------------------------------------------

Old:
----
  evolution-ews-3.20.1.tar.xz
  evolution-ews-ntlm-auth-test-failure.patch

New:
----
  evolution-ews-3.20.2.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ evolution-ews.spec ++++++
--- /var/tmp/diff_new_pack.1wG4S9/_old  2016-05-16 12:01:55.000000000 +0200
+++ /var/tmp/diff_new_pack.1wG4S9/_new  2016-05-16 12:01:55.000000000 +0200
@@ -19,15 +19,13 @@
 Name:           evolution-ews
 # This should be updated upon major version changes; it should match 
BASE_VERSION as defined in configure.in.
 %define evolution_base_version 3.20
-Version:        3.20.1
+Version:        3.20.2
 Release:        0
 Summary:        Exchange Connector for Evolution, compatible with Exchange 
2007 and later
 License:        LGPL-2.1
 Group:          Productivity/Networking/Email/Clients
 Url:            http://projects.gnome.org/evolution/
 Source:         
http://download.gnome.org/sources/evolution-ews/3.20/%{name}-%{version}.tar.xz
-# PATCH-FIX-UPSTREAM evolution-ews-ntlm-auth-test-failure.patch boo#976110 
bgo#765106 [email protected] -- Fix NTLM auth failure with latest samba
-Patch0:         evolution-ews-ntlm-auth-test-failure.patch
 BuildRequires:  fdupes
 BuildRequires:  intltool
 BuildRequires:  translation-update-upstream
@@ -88,7 +86,6 @@
 %lang_package
 %prep
 %setup -q
-%patch0 -p1
 translation-update-upstream
 
 %build

++++++ evolution-ews-3.20.1.tar.xz -> evolution-ews-3.20.2.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/NEWS 
new/evolution-ews-3.20.2/NEWS
--- old/evolution-ews-3.20.1/NEWS       2016-04-11 11:55:01.000000000 +0200
+++ new/evolution-ews-3.20.2/NEWS       2016-05-09 08:56:46.000000000 +0200
@@ -1,3 +1,14 @@
+Evolution-EWS 3.20.2 2016-05-09
+-------------------------------
+
+Bug Fixes:
+       Bug 764976 - Failed message move processed as successful (Milan Crha)
+       Bug 765209 - Correct server version set from string (Milan Crha)
+       Bug 765398 - Online GAL contacts can have incorrect email address 
(Milan Crha)
+
+Miscellaneous:
+       Ask for password after NTLM/SSO authentication failure (Milan Crha)
+
 Evolution-EWS 3.20.1 2016-04-11
 -------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/configure 
new/evolution-ews-3.20.2/configure
--- old/evolution-ews-3.20.1/configure  2016-04-11 11:55:31.000000000 +0200
+++ new/evolution-ews-3.20.2/configure  2016-05-09 08:57:18.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for evolution-ews 3.20.1.
+# Generated by GNU Autoconf 2.69 for evolution-ews 3.20.2.
 #
 # Report bugs to <http://bugzilla.gnome.org/browse.cgi?product=evolution-ews>.
 #
@@ -591,8 +591,8 @@
 # Identity of this package.
 PACKAGE_NAME='evolution-ews'
 PACKAGE_TARNAME='evolution-ews'
-PACKAGE_VERSION='3.20.1'
-PACKAGE_STRING='evolution-ews 3.20.1'
+PACKAGE_VERSION='3.20.2'
+PACKAGE_STRING='evolution-ews 3.20.2'
 PACKAGE_BUGREPORT='http://bugzilla.gnome.org/browse.cgi?product=evolution-ews'
 PACKAGE_URL=''
 
@@ -1518,7 +1518,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures evolution-ews 3.20.1 to adapt to many kinds of systems.
+\`configure' configures evolution-ews 3.20.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1588,7 +1588,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of evolution-ews 3.20.1:";;
+     short | recursive ) echo "Configuration of evolution-ews 3.20.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1794,7 +1794,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-evolution-ews configure 3.20.1
+evolution-ews configure 3.20.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2163,7 +2163,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by evolution-ews $as_me 3.20.1, which was
+It was created by evolution-ews $as_me 3.20.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3026,7 +3026,7 @@
 
 # Define the identity of the package.
  PACKAGE='evolution-ews'
- VERSION='3.20.1'
+ VERSION='3.20.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3265,11 +3265,11 @@
 # precisely one minor behind [ews_version], then allow building against *that*
 # version of EDS and Evo.
 read x NEWSVER y < NEWS
-PREVVER=3.20.$(expr 1 - 1)
+PREVVER=3.20.$(expr 2 - 1)
 if test "$PREVVER" = "$NEWSVER"; then
    EVOREQVER=$PREVVER
 else
-   EVOREQVER=3.20.1
+   EVOREQVER=3.20.2
 fi
 
 
@@ -17911,7 +17911,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by evolution-ews $as_me 3.20.1, which was
+This file was extended by evolution-ews $as_me 3.20.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17977,7 +17977,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-evolution-ews config.status 3.20.1
+evolution-ews config.status 3.20.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/configure.ac 
new/evolution-ews-3.20.2/configure.ac
--- old/evolution-ews-3.20.1/configure.ac       2016-03-21 09:18:27.000000000 
+0100
+++ new/evolution-ews-3.20.2/configure.ac       2016-04-11 11:57:28.000000000 
+0200
@@ -1,7 +1,7 @@
 dnl Evolution-EWS version
 m4_define([ews_major_version], [3])
 m4_define([ews_minor_version], [20])
-m4_define([ews_micro_version], [1])
+m4_define([ews_micro_version], [2])
 
 m4_define([ews_version],
        [ews_major_version.ews_minor_version.ews_micro_version])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/addressbook/e-book-backend-ews.c 
new/evolution-ews-3.20.2/src/addressbook/e-book-backend-ews.c
--- old/evolution-ews-3.20.1/src/addressbook/e-book-backend-ews.c       
2016-04-01 17:34:59.000000000 +0200
+++ new/evolution-ews-3.20.2/src/addressbook/e-book-backend-ews.c       
2016-05-05 11:57:37.000000000 +0200
@@ -586,28 +586,40 @@
 set_email_address (EContact *contact,
                    EContactField field,
                    EEwsItem *item,
-                   const gchar *item_field)
+                   const gchar *item_field,
+                  gboolean require_smtp_prefix)
 {
        const gchar *ea;
 
        ea = e_ews_item_get_email_address (item, item_field);
-       if (ea && g_str_has_prefix (ea, "SMTP:"))
+       if (ea && g_ascii_strncasecmp (ea, "SMTP:", 5) == 0)
                ea = ea + 5;
+       else if (require_smtp_prefix)
+               ea = NULL;
 
        if (ea && *ea)
                e_contact_set (contact, field, ea);
 }
 
 static void
+ebews_populate_emails_ex (EBookBackendEws *ebews,
+                         EContact *contact,
+                         EEwsItem *item,
+                         gboolean require_smtp_prefix)
+{
+       set_email_address (contact, E_CONTACT_EMAIL_1, item, "EmailAddress1", 
require_smtp_prefix);
+       set_email_address (contact, E_CONTACT_EMAIL_2, item, "EmailAddress2", 
require_smtp_prefix);
+       set_email_address (contact, E_CONTACT_EMAIL_3, item, "EmailAddress3", 
require_smtp_prefix);
+}
+
+static void
 ebews_populate_emails (EBookBackendEws *ebews,
                       EContact *contact,
                       EEwsItem *item,
                       GCancellable *cancellable,
                       GError **errror)
 {
-       set_email_address (contact, E_CONTACT_EMAIL_1, item, "EmailAddress1");
-       set_email_address (contact, E_CONTACT_EMAIL_2, item, "EmailAddress2");
-       set_email_address (contact, E_CONTACT_EMAIL_3, item, "EmailAddress3");
+       ebews_populate_emails_ex (ebews, contact, item, FALSE);
 }
 
 static void
@@ -1252,6 +1264,7 @@
        { E_CONTACT_SPOUSE, ELEMENT_TYPE_SIMPLE, "Profession", 
e_ews_item_get_profession},
        { E_CONTACT_SPOUSE, ELEMENT_TYPE_SIMPLE, "SpouseName", 
e_ews_item_get_spouse_name},
        { E_CONTACT_FAMILY_NAME, ELEMENT_TYPE_SIMPLE, "Surname", 
e_ews_item_get_surname},
+       { E_CONTACT_GIVEN_NAME, ELEMENT_TYPE_SIMPLE, "GivenName", 
e_ews_item_get_givenname},
        { E_CONTACT_BIRTH_DATE, ELEMENT_TYPE_COMPLEX, "WeddingAnniversary", 
NULL,  ebews_populate_anniversary, ebews_set_anniversary, 
ebews_set_anniversary_changes },
        { E_CONTACT_PHOTO, ELEMENT_TYPE_COMPLEX, "Photo", NULL,  
ebews_populate_photo, ebews_set_photo, ebews_set_photo_changes },
 
@@ -3434,8 +3447,47 @@
                        e_contact_set (contact, E_CONTACT_FULL_NAME, mb->name);
 
                str = e_contact_get_const (contact, E_CONTACT_EMAIL_1);
-               if (!str || !*str)
+               if (!str || !*str || (contact_item && e_ews_item_get_item_type 
(contact_item) == E_EWS_ITEM_TYPE_CONTACT)) {
+                       /* Cleanup first, then re-add only SMTP addresses */
+                       e_contact_set (contact, E_CONTACT_EMAIL_1, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_2, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_3, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_4, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL, NULL);
+
+                       ebews_populate_emails_ex (ebews, contact, contact_item, 
TRUE);
+               }
+
+               str = e_contact_get_const (contact, E_CONTACT_EMAIL_1);
+               if (!str || !*str) {
                        e_contact_set (contact, E_CONTACT_EMAIL_1, mb->email);
+               } else if (mb->email && (!mb->routing_type || 
g_ascii_strcasecmp (mb->routing_type, "SMTP") == 0)) {
+                       EContactField fields[3] = { E_CONTACT_EMAIL_2, 
E_CONTACT_EMAIL_3, E_CONTACT_EMAIL_4 };
+                       gchar *emails[3];
+                       gint ii, ff = 0;
+
+                       emails[0] = e_contact_get (contact, E_CONTACT_EMAIL_1);
+                       emails[1] = e_contact_get (contact, E_CONTACT_EMAIL_2);
+                       emails[2] = e_contact_get (contact, E_CONTACT_EMAIL_3);
+
+                       /* Make the mailbox email the primary email and skip 
duplicates */
+                       e_contact_set (contact, E_CONTACT_EMAIL_1, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_2, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_3, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL_4, NULL);
+                       e_contact_set (contact, E_CONTACT_EMAIL, NULL);
+
+                       e_contact_set (contact, E_CONTACT_EMAIL_1, mb->email);
+
+                       for (ii = 0; ii < 3; ii++) {
+                               if (emails[ii] && g_ascii_strcasecmp 
(emails[ii], mb->email) != 0) {
+                                       e_contact_set (contact, fields[ff], 
emails[ii]);
+                                       ff++;
+                               }
+
+                               g_free (emails[ii]);
+                       }
+               }
 
                e_data_book_view_notify_update (book_view, contact);
 
@@ -4202,6 +4254,13 @@
        } else {
                ews_backend->priv->is_writable = FALSE;
                e_backend_set_online (backend, FALSE);
+
+               if (e_ews_connection_utils_get_without_password (ews_settings) 
&&
+                          result == E_SOURCE_AUTHENTICATION_REJECTED &&
+                          !e_named_parameters_exists (credentials, 
E_SOURCE_CREDENTIAL_PASSWORD)) {
+                       e_ews_connection_utils_force_off_ntlm_auth_check ();
+                       result = E_SOURCE_AUTHENTICATION_REQUIRED;
+               }
        }
 
        e_book_backend_set_writable (E_BOOK_BACKEND (backend), 
ews_backend->priv->is_writable);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/calendar/e-cal-backend-ews.c 
new/evolution-ews-3.20.2/src/calendar/e-cal-backend-ews.c
--- old/evolution-ews-3.20.1/src/calendar/e-cal-backend-ews.c   2016-03-31 
17:45:10.000000000 +0200
+++ new/evolution-ews-3.20.2/src/calendar/e-cal-backend-ews.c   2016-04-20 
22:43:15.000000000 +0200
@@ -4414,6 +4414,11 @@
 
                ews_start_sync (cal_backend);
                cbews_listen_notifications_cb (cal_backend, NULL, ews_settings);
+       } else if (e_ews_connection_utils_get_without_password (ews_settings) &&
+                  result == E_SOURCE_AUTHENTICATION_REJECTED &&
+                  !e_named_parameters_exists (credentials, 
E_SOURCE_CREDENTIAL_PASSWORD)) {
+               e_ews_connection_utils_force_off_ntlm_auth_check ();
+               result = E_SOURCE_AUTHENTICATION_REQUIRED;
        }
 
        g_object_unref (connection);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/camel/camel-ews-folder.c 
new/evolution-ews-3.20.2/src/camel/camel-ews-folder.c
--- old/evolution-ews-3.20.1/src/camel/camel-ews-folder.c       2016-03-21 
09:16:37.000000000 +0100
+++ new/evolution-ews-3.20.2/src/camel/camel-ews-folder.c       2016-04-14 
14:24:06.000000000 +0200
@@ -1166,7 +1166,7 @@
                folder_id = 
camel_ews_store_summary_get_folder_id_from_folder_type (
                        ews_store->summary, CAMEL_FOLDER_TYPE_JUNK);
 
-               status = e_ews_connection_move_items_sync (
+               status = e_ews_connection_move_items_in_chunks_sync (
                        cnc, EWS_PRIORITY_MEDIUM, folder_id, FALSE,
                        junk_uids, &moved_items, cancellable, &local_error);
 
@@ -1178,17 +1178,20 @@
                        status = ews_refresh_info_sync (folder, cancellable, 
&local_error);
                }
 
-               g_slist_free_full (moved_items, g_object_unref);
-               g_free (folder_id);
-
-               if (status) {
+               /* Messages could be moved partially only, like when
+                  the user cancels the operation in the middle */
+               if (status || moved_items) {
                        CamelFolderChangeInfo *changes;
-                       const GSList *iter;
+                       const GSList *iter, *items_iter;
 
                        changes = camel_folder_change_info_new ();
 
-                       for (iter = junk_uids; iter; iter = g_slist_next 
(iter)) {
+                       for (iter = junk_uids, items_iter = moved_items; iter 
&& items_iter; iter = g_slist_next (iter), items_iter = g_slist_next 
(items_iter)) {
                                const gchar *uid = iter->data;
+                               EEwsItem *item = items_iter->data;
+
+                               if (!item || e_ews_item_get_item_type (item) == 
E_EWS_ITEM_TYPE_ERROR)
+                                       continue;
 
                                camel_folder_summary_lock (folder->summary);
 
@@ -1206,6 +1209,9 @@
                        camel_folder_change_info_free (changes);
                }
 
+               g_slist_free_full (moved_items, g_object_unref);
+               g_free (folder_id);
+
                if (local_error) {
                        camel_ews_store_maybe_disconnect (ews_store, 
local_error);
                        g_propagate_error (error, local_error);
@@ -2047,13 +2053,17 @@
 
        ids = g_slist_reverse (ids);
 
-       if (success && e_ews_connection_move_items_sync (
+       success = success && e_ews_connection_move_items_in_chunks_sync (
                cnc, EWS_PRIORITY_MEDIUM,
                dst_id, !delete_originals,
                ids, &ret_items,
-               cancellable, &local_error)) {
+               cancellable, &local_error);
+
+       /* Messages could be copied/moved partially only, like when
+          the user cancels the operation in the middle */
+       if (success || ret_items) {
                CamelFolderChangeInfo *changes;
-               GSList *l;
+               GSList *l, *processed_items = NULL;
 
                changes = camel_folder_change_info_new ();
 
@@ -2064,10 +2074,14 @@
                        CamelMessageInfo *clone;
                        const EwsId *id;
 
-                       if (e_ews_item_get_item_type (l->data) == 
E_EWS_ITEM_TYPE_ERROR)
+                       if (e_ews_item_get_item_type (l->data) == 
E_EWS_ITEM_TYPE_ERROR) {
+                               if (!local_error)
+                                       local_error = g_error_copy 
(e_ews_item_get_error (l->data));
                                continue;
+                       }
 
                        id = e_ews_item_get_id (l->data);
+                       processed_items = g_slist_prepend (processed_items, 
uids->pdata[i]);
 
                        message = ews_folder_get_message_cached (source, 
uids->pdata[i], cancellable);
                        if (message == NULL)
@@ -2111,10 +2125,12 @@
                if (delete_originals) {
                        changes = camel_folder_change_info_new ();
 
-                       for (i = 0; i < uids->len; i++) {
-                               camel_folder_summary_remove_uid 
(source->summary, uids->pdata[i]);
-                               camel_folder_change_info_remove_uid (changes, 
uids->pdata[i]);
-                               ews_data_cache_remove (CAMEL_EWS_FOLDER 
(source)->cache, "cur", uids->pdata[i], NULL);
+                       for (l = processed_items; l; l = g_slist_next (l)) {
+                               const gchar *uid = l->data;
+
+                               camel_folder_summary_remove_uid 
(source->summary, uid);
+                               camel_folder_change_info_remove_uid (changes, 
uid);
+                               ews_data_cache_remove (CAMEL_EWS_FOLDER 
(source)->cache, "cur", uid, NULL);
                        }
                        if (camel_folder_change_info_changed (changes)) {
                                camel_folder_summary_touch (source->summary);
@@ -2127,8 +2143,13 @@
                /* update destination folder only if not frozen, to not update
                   for each single message transfer during filtering
                 */
-               if (!camel_folder_is_frozen (destination))
+               if (!camel_folder_is_frozen (destination)) {
+                       camel_operation_progress (cancellable, -1);
+
                        ews_refresh_info_sync (destination, cancellable, NULL);
+               }
+
+               g_slist_free (processed_items);
        }
        g_free (dst_id);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/collection/e-ews-backend.c 
new/evolution-ews-3.20.2/src/collection/e-ews-backend.c
--- old/evolution-ews-3.20.1/src/collection/e-ews-backend.c     2015-09-21 
11:59:31.000000000 +0200
+++ new/evolution-ews-3.20.2/src/collection/e-ews-backend.c     2016-04-20 
22:43:15.000000000 +0200
@@ -1045,6 +1045,11 @@
                e_collection_backend_authenticate_children 
(E_COLLECTION_BACKEND (backend), credentials);
 
                e_ews_backend_sync_folders (ews_backend, NULL, 
ews_backend_folders_synced_cb, NULL);
+       } else if (e_ews_connection_utils_get_without_password (ews_settings) &&
+                  result == E_SOURCE_AUTHENTICATION_REJECTED &&
+                  !e_named_parameters_exists (credentials, 
E_SOURCE_CREDENTIAL_PASSWORD)) {
+               e_ews_connection_utils_force_off_ntlm_auth_check ();
+               result = E_SOURCE_AUTHENTICATION_REQUIRED;
        }
 
        return result;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/configuration/e-ews-config-utils.c 
new/evolution-ews-3.20.2/src/configuration/e-ews-config-utils.c
--- old/evolution-ews-3.20.1/src/configuration/e-ews-config-utils.c     
2015-06-17 18:07:41.000000000 +0200
+++ new/evolution-ews-3.20.2/src/configuration/e-ews-config-utils.c     
2016-04-20 22:43:15.000000000 +0200
@@ -383,12 +383,18 @@
 
                        if (result != E_SOURCE_AUTHENTICATION_ACCEPTED) {
                                g_clear_object (&conn);
-                               break;
+                               if (result != E_SOURCE_AUTHENTICATION_REJECTED 
|| local_error)
+                                       break;
                        }
-               } else {
+               }
+
+               if (!conn) {
                        EShell *shell;
                        TryCredentialsData data;
 
+                       e_ews_connection_utils_force_off_ntlm_auth_check ();
+                       g_clear_error (&local_error);
+
                        shell = e_shell_get_default ();
 
                        data.ews_settings = g_object_ref (ews_settings);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/configuration/e-mail-config-ews-autodiscover.c 
new/evolution-ews-3.20.2/src/configuration/e-mail-config-ews-autodiscover.c
--- old/evolution-ews-3.20.1/src/configuration/e-mail-config-ews-autodiscover.c 
2015-03-23 08:28:34.000000000 +0100
+++ new/evolution-ews-3.20.2/src/configuration/e-mail-config-ews-autodiscover.c 
2016-04-20 22:43:15.000000000 +0200
@@ -169,13 +169,21 @@
        gboolean success = FALSE;
 
        if (!g_cancellable_set_error_if_cancelled (cancellable, &local_error) 
&& !local_error) {
-               if (e_ews_connection_utils_get_without_password 
(async_context->ews_settings)) {
+               gboolean without_password;
+
+               without_password = e_ews_connection_utils_get_without_password 
(async_context->ews_settings);
+               if (without_password) {
                        success = e_ews_autodiscover_ws_url_sync (
                                async_context->ews_settings, 
async_context->email_address, "",
                                cancellable, &local_error);
-               } else {
+               }
+
+               if (!without_password || g_error_matches (local_error, 
SOUP_HTTP_ERROR, SOUP_STATUS_UNAUTHORIZED)) {
                        EShell *shell;
 
+                       e_ews_connection_utils_force_off_ntlm_auth_check ();
+                       g_clear_error (&local_error);
+
                        shell = e_shell_get_default ();
 
                        success = e_credentials_prompter_loop_prompt_sync 
(e_shell_get_credentials_prompter (shell),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/server/e-ews-connection-utils.c 
new/evolution-ews-3.20.2/src/server/e-ews-connection-utils.c
--- old/evolution-ews-3.20.1/src/server/e-ews-connection-utils.c        
2014-08-11 09:12:45.000000000 +0200
+++ new/evolution-ews-3.20.2/src/server/e-ews-connection-utils.c        
2016-04-20 22:43:15.000000000 +0200
@@ -67,6 +67,8 @@
        return TRUE;
 }
 
+static gboolean force_off_ntlm_auth_check = FALSE;
+
 static gboolean
 ews_connect_check_ntlm_available (void)
 {
@@ -80,6 +82,9 @@
        gchar *command;
        gint ret;
 
+       if (force_off_ntlm_auth_check)
+               return FALSE;
+
        /* We are attempting to predict what libsoup will do. */
        helper = g_getenv ("SOUP_NTLM_AUTH_DEBUG");
        if (!helper)
@@ -145,6 +150,11 @@
 #endif
 }
 
+void
+e_ews_connection_utils_force_off_ntlm_auth_check (void)
+{
+       force_off_ntlm_auth_check = TRUE;
+}
 
 /* Should we bother to attempt a connection without a password? Remember,
  * this is *purely* an optimisation to avoid that extra round-trip if we
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.20.1/src/server/e-ews-connection-utils.h 
new/evolution-ews-3.20.2/src/server/e-ews-connection-utils.h
--- old/evolution-ews-3.20.1/src/server/e-ews-connection-utils.h        
2014-08-11 09:12:45.000000000 +0200
+++ new/evolution-ews-3.20.2/src/server/e-ews-connection-utils.h        
2016-04-20 22:43:15.000000000 +0200
@@ -32,6 +32,8 @@
                                                         const gchar 
*element_name,
                                                         const gchar 
*expected_name);
 
+void           e_ews_connection_utils_force_off_ntlm_auth_check
+                                                       (void);
 gboolean       e_ews_connection_utils_get_without_password
                                                        (CamelEwsSettings 
*ews_settings);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/server/e-ews-connection.c 
new/evolution-ews-3.20.2/src/server/e-ews-connection.c
--- old/evolution-ews-3.20.1/src/server/e-ews-connection.c      2016-03-21 
09:16:37.000000000 +0100
+++ new/evolution-ews-3.20.2/src/server/e-ews-connection.c      2016-04-21 
14:35:54.000000000 +0200
@@ -57,6 +57,9 @@
 /* For the number of connections */
 #define EWS_CONNECTION_MAX_REQUESTS 1
 
+/* A chunk size limit when moving items in chunks. */
+#define EWS_MOVE_ITEMS_CHUNK_SIZE 500
+
 #define QUEUE_LOCK(x) (g_rec_mutex_lock(&(x)->priv->queue_lock))
 #define QUEUE_UNLOCK(x) (g_rec_mutex_unlock(&(x)->priv->queue_lock))
 
@@ -4204,15 +4207,19 @@
 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;
@@ -6213,6 +6220,75 @@
 
        return success;
 }
+
+gboolean
+e_ews_connection_move_items_in_chunks_sync (EEwsConnection *cnc,
+                                           gint pri,
+                                           const gchar *folder_id,
+                                           gboolean docopy,
+                                           const GSList *ids,
+                                           GSList **items,
+                                           GCancellable *cancellable,
+                                           GError **error)
+{
+       const GSList *iter;
+       guint total_ids = 0, done_ids = 0;
+       gboolean success = TRUE;
+
+       g_return_val_if_fail (E_IS_EWS_CONNECTION (cnc), FALSE);
+       g_return_val_if_fail (items != NULL, FALSE);
+
+       g_object_ref (cnc);
+
+       *items = NULL;
+       iter = ids;
+
+       while (success && iter) {
+               guint n_ids;
+               const GSList *tmp_iter;
+               GSList *processed_items = NULL;
+
+               for (tmp_iter = iter, n_ids = 0; tmp_iter && n_ids < 
EWS_MOVE_ITEMS_CHUNK_SIZE; tmp_iter = g_slist_next (tmp_iter), n_ids++) {
+                       /* Only check bounds first, to avoid unnecessary 
allocations */
+               }
+
+               if (tmp_iter) {
+                       GSList *shorter = NULL;
+
+                       if (total_ids == 0)
+                               total_ids = g_slist_length ((GSList *) ids);
+
+                       for (n_ids = 0; iter && n_ids < 
EWS_MOVE_ITEMS_CHUNK_SIZE; iter = g_slist_next (iter), n_ids++) {
+                               shorter = g_slist_prepend (shorter, iter->data);
+                       }
+
+                       shorter = g_slist_reverse (shorter);
+
+                       success = e_ews_connection_move_items_sync (cnc, pri, 
folder_id, docopy,
+                               shorter, &processed_items, cancellable, error);
+
+                       g_slist_free (shorter);
+
+                       done_ids += n_ids;
+               } else {
+                       success = e_ews_connection_move_items_sync (cnc, pri, 
folder_id, docopy,
+                               iter, &processed_items, cancellable, error);
+
+                       iter = NULL;
+                       done_ids = total_ids;
+               }
+
+               if (processed_items)
+                       *items = g_slist_concat (*items, processed_items);
+
+               if (total_ids > 0)
+                       camel_operation_progress (cancellable, 100 * (gdouble) 
done_ids / (gdouble) total_ids);
+       }
+
+       g_object_unref (cnc);
+
+       return success;
+}
 
 static void
 delete_folder_response_cb (ESoapResponse *response,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/server/e-ews-connection.h 
new/evolution-ews-3.20.2/src/server/e-ews-connection.h
--- old/evolution-ews-3.20.1/src/server/e-ews-connection.h      2016-03-21 
09:16:37.000000000 +0100
+++ new/evolution-ews-3.20.2/src/server/e-ews-connection.h      2016-04-14 
14:23:16.000000000 +0200
@@ -908,6 +908,15 @@
                                                 GSList **items_ret,
                                                 GCancellable *cancellable,
                                                 GError **error);
+gboolean       e_ews_connection_move_items_in_chunks_sync
+                                               (EEwsConnection *cnc,
+                                                gint pri,
+                                                const gchar *folder_id,
+                                                gboolean docopy,
+                                                const GSList *ids,
+                                                GSList **items,
+                                                GCancellable *cancellable,
+                                                GError **error);
 
 void           e_ews_connection_create_attachments
                                                (EEwsConnection *cnc,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/server/e-ews-item.c 
new/evolution-ews-3.20.2/src/server/e-ews-item.c
--- old/evolution-ews-3.20.1/src/server/e-ews-item.c    2016-03-31 
17:45:10.000000000 +0200
+++ new/evolution-ews-3.20.2/src/server/e-ews-item.c    2016-04-27 
18:57:55.000000000 +0200
@@ -62,6 +62,8 @@
        gchar *spouse_name;
        gchar *culture;
        gchar *surname;
+       gchar *givenname;
+       gchar *middlename;
        gchar *notes;
 };
 
@@ -345,6 +347,8 @@
                g_free (con_fields->spouse_name);
                g_free (con_fields->culture);
                g_free (con_fields->surname);
+               g_free (con_fields->givenname);
+               g_free (con_fields->middlename);
                g_free (con_fields->notes);
                g_free (con_fields);
        }
@@ -797,6 +801,10 @@
                priv->contact_fields->spouse_name = 
e_soap_parameter_get_string_value (subparam);
        } else if (!g_ascii_strcasecmp (name, "Surname")) {
                priv->contact_fields->surname = 
e_soap_parameter_get_string_value (subparam);
+       } else if (!g_ascii_strcasecmp (name, "GivenName")) {
+               priv->contact_fields->givenname = 
e_soap_parameter_get_string_value (subparam);
+       } else if (!g_ascii_strcasecmp (name, "MiddleName")) {
+               priv->contact_fields->middlename = 
e_soap_parameter_get_string_value (subparam);
        } else if (!g_ascii_strcasecmp (name, "WeddingAnniversary")) {
                value = e_soap_parameter_get_string_value (subparam);
                priv->contact_fields->wedding_anniversary = ews_item_parse_date 
(value);
@@ -1859,6 +1867,21 @@
        g_return_val_if_fail (E_IS_EWS_ITEM (item), NULL);
        g_return_val_if_fail (item->priv->contact_fields != NULL, NULL);
 
+       if (!item->priv->contact_fields->complete_name && (
+           item->priv->contact_fields->surname ||
+           item->priv->contact_fields->middlename ||
+           item->priv->contact_fields->givenname)) {
+               EwsCompleteName *cn;
+
+               cn = g_new0 (EwsCompleteName, 1);
+
+               cn->first_name = g_strdup 
(item->priv->contact_fields->givenname);
+               cn->middle_name = g_strdup 
(item->priv->contact_fields->middlename);
+               cn->last_name = g_strdup (item->priv->contact_fields->surname);
+
+               item->priv->contact_fields->complete_name = cn;
+       }
+
        return (const EwsCompleteName *) 
item->priv->contact_fields->complete_name;
 }
 
@@ -2057,6 +2080,24 @@
 }
 
 const gchar *
+e_ews_item_get_givenname (EEwsItem *item)
+{
+       g_return_val_if_fail (E_IS_EWS_ITEM (item), NULL);
+       g_return_val_if_fail (item->priv->contact_fields != NULL, NULL);
+
+       return item->priv->contact_fields->givenname;
+}
+
+const gchar *
+e_ews_item_get_middlename (EEwsItem *item)
+{
+       g_return_val_if_fail (E_IS_EWS_ITEM (item), NULL);
+       g_return_val_if_fail (item->priv->contact_fields != NULL, NULL);
+
+       return item->priv->contact_fields->middlename;
+}
+
+const gchar *
 e_ews_item_get_notes (EEwsItem *item)
 {
        g_return_val_if_fail (E_IS_EWS_ITEM (item), NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.20.1/src/server/e-ews-item.h 
new/evolution-ews-3.20.2/src/server/e-ews-item.h
--- old/evolution-ews-3.20.1/src/server/e-ews-item.h    2016-03-31 
17:45:10.000000000 +0200
+++ new/evolution-ews-3.20.2/src/server/e-ews-item.h    2016-04-27 
18:57:55.000000000 +0200
@@ -323,6 +323,8 @@
 const gchar *  e_ews_item_get_spouse_name      (EEwsItem *item);
 const gchar *  e_ews_item_get_culture          (EEwsItem *item);
 const gchar *  e_ews_item_get_surname          (EEwsItem *item);
+const gchar *  e_ews_item_get_givenname        (EEwsItem *item);
+const gchar *  e_ews_item_get_middlename       (EEwsItem *item);
 const gchar *  e_ews_item_get_notes            (EEwsItem *item);
 
 /*Task fields*/


Reply via email to