Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package evolution-ews for openSUSE:Factory 
checked in at 2023-02-14 16:43:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/evolution-ews (Old)
 and      /work/SRC/openSUSE:Factory/.evolution-ews.new.27156 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "evolution-ews"

Tue Feb 14 16:43:01 2023 rev:132 rq:1065579 version:3.46.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/evolution-ews/evolution-ews.changes      
2023-01-10 14:59:51.833223536 +0100
+++ /work/SRC/openSUSE:Factory/.evolution-ews.new.27156/evolution-ews.changes   
2023-02-14 16:43:04.357605979 +0100
@@ -1,0 +2,13 @@
+Fri Feb 10 10:31:53 UTC 2023 - Bjørn Lie <bjorn....@gmail.com>
+
+- Update to version 3.46.4:
+  + Sanitize headers in debug log also for level 1
+  + Bugs fixed:
+    - Calendar:
+      . Cover possible ID conversion for Online meetings
+      . Ensure TimeZone info in SOAP-header request
+      . Convert floating time to user's timezone on save
+    - Disabled sources auto-re-enabled the next start
+    - Subscribed free/busy calendar does not show all events
+
+-------------------------------------------------------------------

Old:
----
  evolution-ews-3.46.3.tar.xz

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

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

Other differences:
------------------
++++++ evolution-ews.spec ++++++
--- /var/tmp/diff_new_pack.Q2Nrzx/_old  2023-02-14 16:43:04.961609563 +0100
+++ /var/tmp/diff_new_pack.Q2Nrzx/_new  2023-02-14 16:43:04.969609611 +0100
@@ -20,7 +20,7 @@
 %define _version %(echo %{version} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+')
 
 Name:           evolution-ews
-Version:        3.46.3
+Version:        3.46.4
 Release:        0
 Summary:        Exchange Connector for Evolution, compatible with Exchange 
2007 and later
 License:        LGPL-2.1-only

++++++ evolution-ews-3.46.3.tar.xz -> evolution-ews-3.46.4.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.46.3/CMakeLists.txt 
new/evolution-ews-3.46.4/CMakeLists.txt
--- old/evolution-ews-3.46.3/CMakeLists.txt     2023-01-06 10:54:21.000000000 
+0100
+++ new/evolution-ews-3.46.4/CMakeLists.txt     2023-02-10 08:44:50.000000000 
+0100
@@ -4,7 +4,7 @@
 cmake_policy(VERSION 3.1)
 
 project(evolution-ews
-       VERSION 3.46.3
+       VERSION 3.46.4
        LANGUAGES C)
 set(PROJECT_BUGREPORT "https://gitlab.gnome.org/GNOME/evolution-ews/issues/";)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.46.3/NEWS 
new/evolution-ews-3.46.4/NEWS
--- old/evolution-ews-3.46.3/NEWS       2023-01-06 10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/NEWS       2023-02-10 08:44:50.000000000 +0100
@@ -1,3 +1,16 @@
+Evolution-EWS 3.46.4 2023-02-10
+-------------------------------
+
+Bug Fixes:
+       I#211 - Calendar: Cover possible ID conversion for Online meetings
+       I#216 - Calendar: Ensure TimeZone info in SOAP-header request
+       I#219 - Disabled sources auto-re-enabled the next start
+       I#220 - Calendar: Convert floating time to user's timezone on save
+       I#221 - Subscribed free/busy calendar does not show all events
+
+Miscellaneous:
+       Sanitize headers in debug log also for level 1
+
 Evolution-EWS 3.46.3 2023-01-06
 -------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews-m365.c 
new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews-m365.c
--- old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews-m365.c  
2023-01-06 10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews-m365.c  
2023-02-10 08:44:50.000000000 +0100
@@ -187,9 +187,20 @@
                                        I_CAL_VEVENT_COMPONENT, new_comp, NULL, 
m365_id, cancellable, error);
                        }
 
-                       if (success && created_item)
+                       if (success && created_item) {
                                *out_new_uid = g_strdup (e_m365_event_get_id 
(created_item));
 
+                               /* Convert from Microsoft Graph ID into EWS ID 
*/
+                               if (*out_new_uid && strchr (*out_new_uid, '-') 
!= NULL) {
+                                       gchar *ptr;
+
+                                       for (ptr = *out_new_uid; *ptr; ptr++) {
+                                               if (*ptr == '-')
+                                                       *ptr = '/';
+                                       }
+                               }
+                       }
+
                        g_clear_pointer (&created_item, json_object_unref);
                        g_clear_object (&builder);
                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews-utils.c 
new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews-utils.c
--- old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews-utils.c 
2023-01-06 10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews-utils.c 
2023-02-10 08:44:50.000000000 +0100
@@ -1123,6 +1123,87 @@
        return ((secs_end - secs_start) > 0) && ((secs_end - secs_start) % (24 
* 60 * 60)) == 0 && (secs_start % 24 * 60 * 60) == 0;
 }
 
+static xmlXPathObjectPtr
+ewscal_xpath_eval_simple (xmlXPathContextPtr ctx,
+                         const gchar *expr)
+{
+       xmlXPathObjectPtr result;
+
+       if (!ctx)
+               return NULL;
+
+       result = xmlXPathEvalExpression ((const xmlChar *) expr, ctx);
+
+       if (result == NULL)
+               return NULL;
+
+       if (result->type == XPATH_NODESET && xmlXPathNodeSetIsEmpty 
(result->nodesetval)) {
+               xmlXPathFreeObject (result);
+               return NULL;
+       }
+
+       return result;
+}
+
+static void
+ewscal_set_timezone_in_request_header (ESoapRequest *request,
+                                      const gchar *msdn_tz_id,
+                                      const gchar *msdn_tz_name)
+{
+       xmlDocPtr doc;
+       xmlXPathContextPtr xpctx;
+       xmlXPathObjectPtr result;
+
+       g_return_if_fail (E_IS_SOAP_REQUEST (request));
+       g_return_if_fail (msdn_tz_id != NULL);
+
+       doc = e_soap_request_get_xml_doc (request);
+       xpctx = xmlXPathNewContext (doc);
+
+       xmlXPathRegisterNs (
+                       xpctx,
+                       (xmlChar *) "s",
+                       (xmlChar *) 
"http://schemas.xmlsoap.org/soap/envelope/";);
+
+       xmlXPathRegisterNs (
+                       xpctx,
+                       (xmlChar *) "t",
+                       (xmlChar *) 
"http://schemas.microsoft.com/exchange/services/2006/types";);
+
+       result = ewscal_xpath_eval_simple (xpctx, 
"/s:Envelope/s:Header/t:TimeZoneContext");
+       if (result) {
+               /* already set, skip it */
+       } else {
+               result = ewscal_xpath_eval_simple (xpctx, 
"/s:Envelope/s:Header");
+               if (result && result->type == XPATH_NODESET && 
result->nodesetval && result->nodesetval->nodeNr > 0) {
+                       xmlNode *header_node = result->nodesetval->nodeTab[0];
+                       xmlNode *tzcontext_node, *tzdef_node;
+                       xmlNs *types_ns;
+
+                       tzcontext_node = xmlNewChild (header_node, NULL, (const 
xmlChar *) "TimeZoneContext", NULL);
+                       types_ns = xmlNewNs (tzcontext_node,
+                               (const xmlChar *) 
"http://schemas.microsoft.com/exchange/services/2006/types";,
+                               (const xmlChar *) "types");
+                       xmlSetNs (tzcontext_node, types_ns);
+
+                       tzdef_node = xmlNewChild (tzcontext_node, NULL, (const 
xmlChar *) "TimeZoneDefinition", NULL);
+                       types_ns = xmlNewNs (tzdef_node,
+                               (const xmlChar *) 
"http://schemas.microsoft.com/exchange/services/2006/types";,
+                               (const xmlChar *) "types");
+                       xmlSetNs (tzdef_node, types_ns);
+
+                       if (msdn_tz_id)
+                               xmlNewNsProp (tzdef_node, NULL, (const xmlChar 
*) "Id", (const xmlChar *) msdn_tz_id);
+                       if (msdn_tz_name)
+                               xmlNewNsProp (tzdef_node, NULL, (const xmlChar 
*) "Name", (const xmlChar *) msdn_tz_name);
+               }
+       }
+
+       if (result)
+               xmlXPathFreeObject (result);
+       xmlXPathFreeContext (xpctx);
+}
+
 static gboolean
 convert_vevent_calcomp_to_xml (ESoapRequest *request,
                                gpointer user_data,
@@ -1174,13 +1255,13 @@
        tzid_start = dtstart ? i_cal_time_get_timezone (dtstart) : NULL;
        if (!tzid_start)
                tzid_start = convert_data->default_zone;
-       ical_location_start = i_cal_timezone_get_location (tzid_start);
+       ical_location_start = tzid_start ? i_cal_timezone_get_location 
(tzid_start) : NULL;
 
        dtend = e_cal_backend_ews_get_datetime_with_zone 
(convert_data->timezone_cache, convert_data->vcalendar, icomp, 
I_CAL_DTEND_PROPERTY, i_cal_property_get_dtend);
        tzid_end = dtend ? i_cal_time_get_timezone (dtend) : NULL;
        if (!tzid_end)
                tzid_end = convert_data->default_zone;
-       ical_location_end = i_cal_timezone_get_location (tzid_end);
+       ical_location_end = tzid_end ? i_cal_timezone_get_location (tzid_end) : 
NULL;
 
        satisfies = e_ews_connection_satisfies_server_version 
(convert_data->connection, E_EWS_EXCHANGE_2010);
        if (satisfies && ical_location_start != NULL && ical_location_end != 
NULL) {
@@ -1271,8 +1352,13 @@
                                &tzds,
                                NULL,
                                NULL)) {
-                       ewscal_set_timezone (request, "StartTimeZone", 
tzds->data);
-                       ewscal_set_timezone (request, "EndTimeZone", 
tzds->data);
+                       EEwsCalendarTimeZoneDefinition *tzdef = tzds->data;
+
+                       ewscal_set_timezone (request, "StartTimeZone", tzdef);
+                       ewscal_set_timezone (request, "EndTimeZone", tzdef);
+
+                       if (tzdef && tzdef->id)
+                               ewscal_set_timezone_in_request_header (request, 
tzdef->id, tzdef->name);
                }
 
                g_slist_free (msdn_locations);
@@ -1786,10 +1872,15 @@
 
                                tmp = tzds;
                                if (tzid_start != NULL) {
+                                       EEwsCalendarTimeZoneDefinition *tzdef = 
tmp->data;
+
                                        e_ews_request_start_set_item_field 
(request, "StartTimeZone", "calendar", "CalendarItem");
-                                       ewscal_set_timezone (request, 
"StartTimeZone", tmp->data);
+                                       ewscal_set_timezone (request, 
"StartTimeZone", tzdef);
                                        e_ews_request_end_set_item_field 
(request);
 
+                                       if (tzdef && tzdef->id)
+                                               
ewscal_set_timezone_in_request_header (request, tzdef->id, tzdef->name);
+
                                        /*
                                         * Exchange server is smart enough to 
return the list of
                                         * ServerTimeZone without repeated 
elements
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews.c 
new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews.c
--- old/evolution-ews-3.46.3/src/EWS/calendar/e-cal-backend-ews.c       
2023-01-06 10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/calendar/e-cal-backend-ews.c       
2023-02-10 08:44:50.000000000 +0100
@@ -3031,7 +3031,7 @@
                convert_data.old_comp = oldcomp;
                convert_data.item_id = itemid;
                convert_data.change_key = changekey;
-               convert_data.default_zone = i_cal_timezone_get_utc_timezone ();
+               convert_data.default_zone = calendar_config_get_icaltimezone ();
 
                if (!(opflags & E_CAL_OPERATION_FLAG_DISABLE_ITIP_MESSAGE) &&
                    e_cal_component_has_attendees (comp) &&
@@ -3277,7 +3277,7 @@
                convert_data.connection = cbews->priv->cnc;
                convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews);
                convert_data.icomp = icomp;
-               convert_data.default_zone = i_cal_timezone_get_utc_timezone ();
+               convert_data.default_zone = calendar_config_get_icaltimezone ();
 
                success = e_ews_connection_create_items_sync (cbews->priv->cnc, 
EWS_PRIORITY_MEDIUM, "SaveOnly", send_meeting_invitations,
                        fid, e_cal_backend_ews_convert_calcomp_to_xml, 
&convert_data,
@@ -3667,7 +3667,7 @@
        convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews);
        convert_data.icomp = subcomp;
        convert_data.vcalendar = vcalendar;
-       convert_data.default_zone = i_cal_timezone_get_utc_timezone ();
+       convert_data.default_zone = calendar_config_get_icaltimezone ();
 
        fid = e_ews_folder_id_new (cbews->priv->folder_id, NULL, FALSE);
 
@@ -3981,7 +3981,7 @@
                                sub_convert_data.old_comp = comp; /* no change, 
just detach the instance */
                                sub_convert_data.item_id = item_id;
                                sub_convert_data.change_key = change_key;
-                               sub_convert_data.default_zone = 
i_cal_timezone_get_utc_timezone ();
+                               sub_convert_data.default_zone = 
calendar_config_get_icaltimezone ();
 
                                e_ews_connection_update_items_sync 
(cbews->priv->cnc, EWS_PRIORITY_MEDIUM,
                                        "AlwaysOverwrite", "SaveOnly", 
"SendToNone", cbews->priv->folder_id,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.46.3/src/EWS/common/e-ews-connection.c 
new/evolution-ews-3.46.4/src/EWS/common/e-ews-connection.c
--- old/evolution-ews-3.46.3/src/EWS/common/e-ews-connection.c  2023-01-06 
10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/common/e-ews-connection.c  2023-02-10 
08:44:50.000000000 +0100
@@ -200,7 +200,7 @@
 
                if (log_level >= 4)
                        soup_logger_set_printer (logger, 
e_ews_soup_log_printer, NULL, NULL);
-               else if (log_level == 2)
+               else if (log_level == 1 || log_level == 2)
                        soup_logger_set_printer (logger, 
e_ews_debug_soup_log_printer_stdout, NULL, NULL);
 
                soup_session_add_feature (SOUP_SESSION (session), 
SOUP_SESSION_FEATURE (logger));
@@ -6451,6 +6451,7 @@
             event_param != NULL;
             event_param = e_soap_parameter_get_next_child (event_param)) {
                ICalPeriod *ipt;
+               gboolean is_recurring = FALSE;
 
                ipt = i_cal_period_new_null_period ();
 
@@ -6535,12 +6536,40 @@
                                        g_clear_pointer (&location, g_free);
                                        location = 
e_soap_parameter_get_string_value (dparam);
                                }
+
+                               dparam = 
e_soap_parameter_get_first_child_by_name (subparam, "IsRecurring");
+                               if (dparam) {
+                                       value = 
e_soap_parameter_get_string_value (dparam);
+                                       is_recurring = g_strcmp0 (value, 
"true") == 0;
+                                       g_free (value);
+                               }
                        }
                }
 
                if (prop) {
-                       if (id)
+                       if (id) {
+                               /* Unique-ize the ID for the recurring events, 
otherwise the ID clashes when
+                                  more items are from the same series/event. */
+                               if (is_recurring) {
+                                       ICalTime *itt;
+
+                                       itt = i_cal_period_get_start (ipt);
+                                       if (itt) {
+                                               gchar *itt_str, *tmp;
+
+                                               itt_str = 
i_cal_time_as_ical_string (itt);
+                                               tmp = g_strconcat (id, "-", 
itt_str, NULL);
+
+                                               g_free (id);
+                                               g_free (itt_str);
+
+                                               id = tmp;
+                                       }
+                                       g_clear_object (&itt);
+                               }
+
                                i_cal_property_set_parameter_from_string (prop, 
"X-EWS-ID", id);
+                       }
                        if (summary)
                                i_cal_property_set_parameter_from_string (prop, 
"X-SUMMARY", summary);
                        if (location)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/evolution-ews-3.46.3/src/EWS/common/e-ews-debug.c 
new/evolution-ews-3.46.4/src/EWS/common/e-ews-debug.c
--- old/evolution-ews-3.46.3/src/EWS/common/e-ews-debug.c       2023-01-06 
10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/common/e-ews-debug.c       2023-02-10 
08:44:50.000000000 +0100
@@ -94,7 +94,7 @@
        const gchar *filtered_data = NULL;
        gint log_level = e_ews_debug_get_log_level ();
 
-       if (log_level == 2 || log_level > 3) {
+       if (log_level == 1 || log_level == 2 || log_level > 3) {
                if (direction == '>' && g_ascii_strncasecmp (data, "Host:", 5) 
== 0)
                        filtered_data = "Host: <redacted>";
                else if (direction == '>' && g_ascii_strncasecmp (data, 
"Authorization:", 14) == 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/evolution-ews-3.46.3/src/EWS/registry/e-ews-backend.c 
new/evolution-ews-3.46.4/src/EWS/registry/e-ews-backend.c
--- old/evolution-ews-3.46.3/src/EWS/registry/e-ews-backend.c   2023-01-06 
10:54:21.000000000 +0100
+++ new/evolution-ews-3.46.4/src/EWS/registry/e-ews-backend.c   2023-02-10 
08:44:50.000000000 +0100
@@ -141,38 +141,6 @@
 }
 
 static void
-ews_backend_update_enabled (ESource *data_source,
-                           ESource *collection_source)
-{
-       ESourceCollection *collection_extension = NULL;
-       gboolean part_enabled = TRUE;
-
-       g_return_if_fail (E_IS_SOURCE (data_source));
-
-       if (!collection_source || !e_source_get_enabled (collection_source)) {
-               e_source_set_enabled (data_source, FALSE);
-               return;
-       }
-
-       if (e_source_has_extension (collection_source, 
E_SOURCE_EXTENSION_COLLECTION))
-               collection_extension = e_source_get_extension 
(collection_source, E_SOURCE_EXTENSION_COLLECTION);
-
-       if (e_source_has_extension (data_source, E_SOURCE_EXTENSION_CALENDAR) ||
-           e_source_has_extension (data_source, E_SOURCE_EXTENSION_TASK_LIST) 
||
-           e_source_has_extension (data_source, E_SOURCE_EXTENSION_MEMO_LIST)) 
{
-               part_enabled = !collection_extension || 
e_source_collection_get_calendar_enabled (collection_extension);
-       } else if (e_source_has_extension (data_source, 
E_SOURCE_EXTENSION_ADDRESS_BOOK)) {
-               part_enabled = !collection_extension || 
e_source_collection_get_contacts_enabled (collection_extension);
-       } else if (e_source_has_extension (data_source, 
E_SOURCE_EXTENSION_MAIL_ACCOUNT) ||
-                  e_source_has_extension (data_source, 
E_SOURCE_EXTENSION_MAIL_IDENTITY) ||
-                  e_source_has_extension (data_source, 
E_SOURCE_EXTENSION_MAIL_TRANSPORT)) {
-               part_enabled = !collection_extension || 
e_source_collection_get_mail_enabled (collection_extension);
-       }
-
-       e_source_set_enabled (data_source, part_enabled);
-}
-
-static void
 ews_backend_sync_authentication (EEwsBackend *ews_backend,
                                 ESource *child_source)
 {
@@ -244,7 +212,6 @@
        e_source_backend_set_backend_name (
                E_SOURCE_BACKEND (extension), "ews");
        ews_backend_sync_authentication (backend, source);
-       ews_backend_update_enabled (source, e_backend_get_source (E_BACKEND 
(backend)));
 
        if (e_ews_folder_get_folder_type (folder) != E_EWS_FOLDER_TYPE_CONTACTS 
&&
            !e_source_has_extension (source, E_SOURCE_EXTENSION_EWS_FOLDER) &&
@@ -496,23 +463,10 @@
        const gchar *oal_id = NULL;
        const gchar *uid;
        gchar *oal_selected;
-       gboolean can_enable;
 
        settings = ews_backend_get_settings (backend);
        collection_backend = E_COLLECTION_BACKEND (backend);
        source = e_backend_get_source (E_BACKEND (backend));
-       if (source) {
-               ESourceCollection *collection_extension = NULL;
-
-               if (e_source_has_extension (source, 
E_SOURCE_EXTENSION_COLLECTION))
-                       collection_extension = e_source_get_extension (source, 
E_SOURCE_EXTENSION_COLLECTION);
-
-               can_enable = !collection_extension || (e_source_get_enabled 
(source) &&
-                       e_source_collection_get_contacts_enabled 
(collection_extension));
-       } else {
-               can_enable = FALSE;
-       }
-
        gal_uid = camel_ews_settings_get_gal_uid (settings);
 
        if (gal_uid != NULL) {
@@ -521,7 +475,6 @@
                g_object_unref (server);
 
                if (source != NULL) {
-                       e_source_set_enabled (source, can_enable);
                        g_object_unref (source);
                        return;
                }
@@ -558,7 +511,6 @@
 
        source = e_collection_backend_new_child (
                collection_backend, oal_id);
-       e_source_set_enabled (source, can_enable);
        ews_backend_sync_authentication (backend, source);
 
        e_source_set_display_name (source, display_name);
@@ -604,10 +556,8 @@
        ESource *m365_source;
        ESourceAuthentication *auth_extension;
        ESourceAuthentication *collection_auth_extension;
-       ESourceCollection *collection_extension = NULL;
        ESourceExtension *source_extension;
        ESourceRegistryServer *server;
-       gboolean can_enable;
        gchar *display_name;
 
        ews_settings = ews_backend_get_settings (ews_backend);
@@ -623,15 +573,8 @@
        /* Make sure the ESourceCamel knows about it, even when no Microsoft365 
mail account is created */
        e_source_camel_generate_subtype ("microsoft365", 
CAMEL_TYPE_M365_SETTINGS);
 
-       if (e_source_has_extension (collection_source, 
E_SOURCE_EXTENSION_COLLECTION))
-               collection_extension = e_source_get_extension 
(collection_source, E_SOURCE_EXTENSION_COLLECTION);
-
-       can_enable = !collection_extension || (e_source_get_enabled 
(collection_source) &&
-               e_source_collection_get_contacts_enabled 
(collection_extension));
-
        collection_backend = E_COLLECTION_BACKEND (ews_backend);
        m365_source = e_collection_backend_new_child (collection_backend, 
EWS_HELPER_M365_RESOURCE_ID);
-       e_source_set_enabled (m365_source, can_enable);
 
        display_name = g_strconcat (e_source_get_display_name 
(collection_source), " (Microsoft365)", NULL);
 
@@ -712,7 +655,6 @@
                                E_SERVER_SIDE_SOURCE (source), TRUE);
                        e_server_side_source_set_remote_deletable (
                                E_SERVER_SIDE_SOURCE (source), TRUE);
-                       ews_backend_update_enabled (source, 
e_backend_get_source (E_BACKEND (backend)));
                        e_source_registry_server_add_source (registry, source);
                } else {
                        GError *error = NULL;
@@ -867,7 +809,6 @@
        for (iter = old_resources; iter; iter = g_list_next (iter)) {
                ESource *source = iter->data;
 
-               ews_backend_update_enabled (source, e_backend_get_source 
(E_BACKEND (backend)));
                e_source_registry_server_add_source (registry, source);
        }
 
@@ -909,18 +850,21 @@
                        G_CALLBACK (ews_backend_source_changed_cb), 
ews_backend);
        }
 
-       /* do not do anything, if account is disabled */
-       if (!e_collection_backend_get_part_enabled (collection_backend, 
E_COLLECTION_BACKEND_PART_ANY))
+       /* only claim old sources, when the account is disabled, thus
+          those sources can be auto-enabled when the account is enabled */
+       if (!e_collection_backend_get_part_enabled (collection_backend, 
E_COLLECTION_BACKEND_PART_ANY)) {
+               ews_backend_claim_old_resources (collection_backend);
                return;
+       }
 
        if (!e_collection_backend_freeze_populate (collection_backend)) {
                e_collection_backend_thaw_populate (collection_backend);
                return;
        }
 
+       ews_backend_claim_old_resources (collection_backend);
        ews_backend_add_gal_source (ews_backend);
        ews_backend_maybe_add_m365_source (ews_backend);
-       ews_backend_claim_old_resources (collection_backend);
 
        if (e_backend_get_online (backend)) {
                CamelEwsSettings *ews_settings;

Reply via email to