Hello community, here is the log from the commit of package evolution-ews for openSUSE:Factory checked in at 2018-07-19 22:49:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/evolution-ews (Old) and /work/SRC/openSUSE:Factory/.evolution-ews.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "evolution-ews" Thu Jul 19 22:49:05 2018 rev:88 rq:623619 version:3.28.4 Changes: -------- --- /work/SRC/openSUSE:Factory/evolution-ews/evolution-ews.changes 2018-06-22 13:28:20.606263187 +0200 +++ /work/SRC/openSUSE:Factory/.evolution-ews.new/evolution-ews.changes 2018-07-19 22:49:08.219122615 +0200 @@ -1,0 +2,8 @@ +Mon Jul 16 18:31:40 UTC 2018 - [email protected] + +- Update to version 3.28.4: + + Bugs fixed: bgo#796297, glgo#GNOME/evolution-ews#12, + glgo#GNOME/evolution-ews#4, glgo#GNOME/evolution-ews#5, + glgo#GNOME/evolution-ews#2, glgo#GNOME/evolution-ews#7. + +------------------------------------------------------------------- Old: ---- evolution-ews-3.28.3.tar.xz New: ---- evolution-ews-3.28.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ evolution-ews.spec ++++++ --- /var/tmp/diff_new_pack.hSU25a/_old 2018-07-19 22:49:08.907120370 +0200 +++ /var/tmp/diff_new_pack.hSU25a/_new 2018-07-19 22:49:08.911120356 +0200 @@ -19,7 +19,7 @@ # _version needs to be %{version} stripped to major.minor.micro only... %define _version %(echo %{version} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+') Name: evolution-ews -Version: 3.28.3 +Version: 3.28.4 Release: 0 Summary: Exchange Connector for Evolution, compatible with Exchange 2007 and later License: LGPL-2.1-only ++++++ evolution-ews-3.28.3.tar.xz -> evolution-ews-3.28.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/CMakeLists.txt new/evolution-ews-3.28.4/CMakeLists.txt --- old/evolution-ews-3.28.3/CMakeLists.txt 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/CMakeLists.txt 2018-07-16 14:18:12.000000000 +0200 @@ -4,7 +4,7 @@ cmake_policy(VERSION 3.1) project(evolution-ews - VERSION 3.28.3 + VERSION 3.28.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.28.3/NEWS new/evolution-ews-3.28.4/NEWS --- old/evolution-ews-3.28.3/NEWS 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/NEWS 2018-07-16 14:18:12.000000000 +0200 @@ -1,3 +1,14 @@ +Evolution-EWS 3.28.4 2018-07-16 +------------------------------- + +Bug Fixes: + Bug 796297 - Make it possible to not request RSVP (all-or-nothing) ][ (Milan Crha) + eds-I#12 - vCard REV attribute should be a timestamp (Milan Crha) + I#4 - Automatic junk filtering doesn't work (Milan Crha) + I#5 - Cannot set/change task priority (Milan Crha) + I#2 - Silently ignore broken items on fetch in calendars (Milan Crha) + I#7 - Event timezone not always properly set on the server (Milan Crha) + Evolution-EWS 3.28.3 2018-06-18 ------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/addressbook/e-book-backend-ews.c new/evolution-ews-3.28.4/src/addressbook/e-book-backend-ews.c --- old/evolution-ews-3.28.3/src/addressbook/e-book-backend-ews.c 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/addressbook/e-book-backend-ews.c 2018-07-16 14:18:12.000000000 +0200 @@ -51,12 +51,23 @@ #include "ews-oab-decoder.h" #include "ews-oab-decompress.h" +#ifdef G_OS_WIN32 +#ifdef gmtime_r +#undef gmtime_r +#endif + +/* The gmtime() in Microsoft's C library is MT-safe */ +#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0) +#endif + #define d(x) #define EDB_ERROR(_code) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, NULL) #define EDB_ERROR_EX(_code,_msg) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, _msg) #define X_EWS_ORIGINAL_VCARD "X-EWS-ORIGINAL-VCARD" +#define X_EWS_CHANGEKEY "X-EWS-CHANGEKEY" +#define X_EWS_GAL_SHA1 "X-EWS-GAL-SHA1" #define EWS_MAX_FETCH_COUNT 500 @@ -66,7 +77,7 @@ /* passing field uris for PhysicalAddress, PhoneNumbers causes error, so we * use Default view to fetch them. Thus the summary props just have attachments * and some additional properties that are not return with Default view */ -#define CONTACT_ITEM_PROPS "item:Attachments item:HasAttachments item:Body contacts:Manager contacts:Department contacts:SpouseName contacts:AssistantName contacts:BusinessHomePage contacts:Birthday" +#define CONTACT_ITEM_PROPS "item:Attachments item:HasAttachments item:Body item:LastModifiedTime contacts:Manager contacts:Department contacts:SpouseName contacts:AssistantName contacts:BusinessHomePage contacts:Birthday" struct _EBookBackendEwsPrivate { GRecMutex cnc_lock; @@ -187,6 +198,31 @@ }; static void +ebews_populate_rev (EContact *contact, + EEwsItem *item) +{ + struct tm stm; + time_t tt = 0; + gchar time_string[100] = { 0 }; + + g_return_if_fail (E_IS_CONTACT (contact)); + + if (item) { + g_return_if_fail (E_IS_EWS_ITEM (item)); + + tt = e_ews_item_get_last_modified_time (item); + } + + if (tt <= 0) + tt = time (NULL); + + gmtime_r (&tt, &stm); + strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", &stm); + + e_contact_set (contact, E_CONTACT_REV, time_string); +} + +static void ebews_populate_uid (EBookBackendEws *bbews, EContact *contact, EEwsItem *item, @@ -198,7 +234,8 @@ id = e_ews_item_get_id (item); if (id) { e_contact_set (contact, E_CONTACT_UID, id->id); - e_contact_set (contact, E_CONTACT_REV, id->change_key); + ebews_populate_rev (contact, item); + e_vcard_util_set_x_attribute (E_VCARD (contact), X_EWS_CHANGEKEY, id->change_key); } } @@ -860,7 +897,9 @@ if (!item_id) { id = g_new0 (EwsId, 1); id->id = e_contact_get (contact, E_CONTACT_UID); - id->change_key = e_contact_get (contact, E_CONTACT_REV); + id->change_key = e_vcard_util_dup_x_attribute (E_VCARD (contact), X_EWS_CHANGEKEY); + if (!id->change_key) + id->change_key = e_contact_get (contact, E_CONTACT_REV); item_id = id; } @@ -1442,15 +1481,24 @@ ConvertData *cd = user_data; EContact *old_contact = cd->old_contact; EContact *new_contact = cd->new_contact; + gchar *change_key = NULL; + + if (!cd->change_key) { + change_key = e_vcard_util_dup_x_attribute (E_VCARD (old_contact), X_EWS_CHANGEKEY); + if (!change_key) + change_key = e_contact_get (old_contact, E_CONTACT_REV); + } e_ews_message_start_item_change (msg, E_EWS_ITEMCHANGE_TYPE_ITEM, e_contact_get_const (old_contact, E_CONTACT_UID), - cd->change_key ? cd->change_key : e_contact_get_const (old_contact, E_CONTACT_REV), + cd->change_key ? cd->change_key : change_key, 0); e_ews_message_start_set_item_field (msg, "Members", "distributionlist", "DistributionList"); ebb_ews_write_dl_members (msg, new_contact); e_ews_message_end_set_item_field (msg); e_ews_message_end_item_change (msg); + + g_free (change_key); } static void @@ -1461,6 +1509,7 @@ EContact *old_contact = cd->old_contact; EContact *new_contact = cd->new_contact; gchar *value = NULL, *old_value = NULL; + gchar *change_key = NULL; gint i, element_type; /* Pre-flight, to update the ChangeKey if needed */ @@ -1482,9 +1531,15 @@ } } + if (!cd->change_key) { + change_key = e_vcard_util_dup_x_attribute (E_VCARD (old_contact), X_EWS_CHANGEKEY); + if (!change_key) + change_key = e_contact_get (old_contact, E_CONTACT_REV); + } + e_ews_message_start_item_change (msg, E_EWS_ITEMCHANGE_TYPE_ITEM, e_contact_get_const (old_contact, E_CONTACT_UID), - cd->change_key ? cd->change_key : e_contact_get_const (old_contact, E_CONTACT_REV), + cd->change_key ? cd->change_key : change_key, 0); /* Iterate for each field in contact */ @@ -1516,6 +1571,8 @@ } e_ews_message_end_item_change (msg); + + g_free (change_key); } static EContact * @@ -1675,6 +1732,7 @@ static EContact * ebb_ews_get_dl_info (EBookBackendEws *bbews, + EEwsItem *item, const EwsId *id, const gchar *d_name, GSList *members, @@ -1687,7 +1745,8 @@ contact = e_contact_new (); e_contact_set (contact, E_CONTACT_UID, id->id); - e_contact_set (contact, E_CONTACT_REV, id->change_key); + e_vcard_util_set_x_attribute (E_VCARD (contact), X_EWS_CHANGEKEY, id->change_key); + ebews_populate_rev (contact, item); e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (TRUE)); e_contact_set (contact, E_CONTACT_LIST_SHOW_ADDRESSES, GINT_TO_POINTER (TRUE)); @@ -1739,6 +1798,7 @@ static gboolean ebb_ews_contacts_append_dl (EBookBackendEws *bbews, + EEwsItem *item, const EwsId *id, const gchar *d_name, GSList *members, @@ -1749,7 +1809,7 @@ EContact *contact; EVCardAttribute *attr; - contact = ebb_ews_get_dl_info (bbews, id, d_name, members, cancellable, error); + contact = ebb_ews_get_dl_info (bbews, item, id, d_name, members, cancellable, error); if (contact == NULL) return FALSE; @@ -1837,7 +1897,7 @@ if (e_ews_connection_expand_dl_sync ( bbews->priv->cnc, EWS_PRIORITY_MEDIUM, mb, &members, &includes_last, cancellable, &local_error)) { - ret = ebb_ews_contacts_append_dl (bbews, id, d_name, members, contacts, cancellable, error); + ret = ebb_ews_contacts_append_dl (bbews, item, id, d_name, members, contacts, cancellable, error); g_slist_free_full (members, (GDestroyNotify) e_ews_mailbox_free); } else { ret = g_error_matches (local_error, EWS_CONNECTION_ERROR, EWS_CONNECTION_ERROR_NAMERESOLUTIONNORESULTS); @@ -2165,9 +2225,10 @@ const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID); EBookMetaBackendInfo *nfo; - e_contact_set (contact, E_CONTACT_REV, sha1); + ebews_populate_rev (contact, NULL); + e_vcard_util_set_x_attribute (E_VCARD (contact), X_EWS_GAL_SHA1, sha1); - nfo = e_book_meta_backend_info_new (uid, sha1, NULL, NULL); + nfo = e_book_meta_backend_info_new (uid, e_contact_get_const (contact, E_CONTACT_REV), NULL, NULL); nfo->object = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); if (g_hash_table_remove (data->uids, uid)) { @@ -2197,18 +2258,27 @@ gpointer user_data) { struct _db_data *data = user_data; - gchar *dup_uid, *dup_rev; + EVCard *vcard; + gchar *dup_uid, *dup_sha1 = NULL; g_return_val_if_fail (data != NULL, FALSE); g_return_val_if_fail (data->uids != NULL, FALSE); g_return_val_if_fail (data->sha1s != NULL, FALSE); + g_return_val_if_fail (object != NULL, FALSE); + + vcard = e_vcard_new_from_string (object); + if (vcard) { + dup_sha1 = e_vcard_util_dup_x_attribute (vcard, X_EWS_GAL_SHA1); + g_object_unref (vcard); + } dup_uid = g_strdup (uid); - dup_rev = g_strdup (revision); + if (!dup_sha1) + dup_sha1 = g_strdup (revision); - g_hash_table_insert (data->uids, dup_uid, dup_rev); - if (dup_rev) - g_hash_table_insert (data->sha1s, dup_rev, dup_uid); + g_hash_table_insert (data->uids, dup_uid, dup_sha1); + if (dup_sha1) + g_hash_table_insert (data->sha1s, dup_sha1, dup_uid); return TRUE; } @@ -2603,7 +2673,6 @@ EContact *contact = NULL; gboolean is_public_dl = FALSE; const gchar *str; - gchar *fake_rev; if (g_strcmp0 (mb->mailbox_type, "PublicDL") == 0) { contact = e_contact_new (); @@ -2626,11 +2695,7 @@ /* There is no ChangeKey provided either, thus make up some revision, to have the contact always updated in the local cache. */ - fake_rev = e_util_generate_uid (); - - e_contact_set (contact, E_CONTACT_REV, fake_rev); - - g_free (fake_rev); + ebews_populate_rev (contact, NULL); str = e_contact_get_const (contact, E_CONTACT_FULL_NAME); if (!str || !*str) @@ -2739,8 +2804,20 @@ EContact *existing = NULL; if (e_book_cache_get_contact (book_cache, id->id, TRUE, &existing, cancellable, NULL) && - existing && g_strcmp0 (e_contact_get_const (existing, E_CONTACT_REV), id->change_key) == 0) { - g_object_unref (item); + existing) { + gchar *change_key; + + change_key = e_vcard_util_dup_x_attribute (E_VCARD (existing), X_EWS_CHANGEKEY); + if (!change_key) + change_key = e_contact_get (existing, E_CONTACT_REV); + + if (g_strcmp0 (change_key, id->change_key) == 0) { + g_object_unref (item); + } else { + items = g_slist_prepend (items, item); + } + + g_free (change_key); } else { items = g_slist_prepend (items, item); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews-utils.c new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews-utils.c --- old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews-utils.c 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews-utils.c 2018-07-16 14:18:12.000000000 +0200 @@ -1113,11 +1113,11 @@ e_ews_message_write_string_parameter (msg, "ReminderIsSet", NULL, "false"); /* start time, end time and meeting time zone */ - dtstart = icalcomponent_get_dtstart (icalcomp); + dtstart = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); tzid_start = (icaltimezone *) (dtstart.zone ? dtstart.zone : convert_data->default_zone); ical_location_start = icaltimezone_get_location (tzid_start); - dtend = icalcomponent_get_dtend (icalcomp); + dtend = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTEND_PROPERTY, icalproperty_get_dtend); tzid_end = (icaltimezone *) (dtend.zone ? dtend.zone : convert_data->default_zone); ical_location_end = icaltimezone_get_location (tzid_end); @@ -1227,6 +1227,18 @@ g_object_unref (comp); } +static const gchar * +ews_priority_to_string (gint priority) +{ + if (priority <= 3) + return "High"; + + if (priority >= 7) + return "Low"; + + return "Normal"; +} + static void convert_vtodo_calcomp_to_xml (ESoapMessage *msg, gpointer user_data) @@ -1248,9 +1260,17 @@ convert_categories_calcomp_to_xml (msg, NULL, icalcomp); + prop = icalcomponent_get_first_property (icalcomp, ICAL_PRIORITY_PROPERTY); + if (prop) { + gint priority; + + priority = icalproperty_get_priority (prop); + e_ews_message_write_string_parameter (msg, "Importance", NULL, ews_priority_to_string (priority)); + } + prop = icalcomponent_get_first_property (icalcomp, ICAL_DUE_PROPERTY); if (prop) { - dt = icalproperty_get_due (prop); + dt = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DUE_PROPERTY, icalproperty_get_due); e_ews_cal_utils_set_time (msg, "DueDate", &dt, TRUE); } @@ -1263,7 +1283,7 @@ prop = icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY); if (prop) { - dt = icalproperty_get_dtstart (prop); + dt = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); e_ews_cal_utils_set_time (msg, "StartDate", &dt, TRUE); } @@ -1514,8 +1534,8 @@ } /* Update other properties allowed only for meeting organizers*/ /*meeting dates*/ - dtstart = icalcomponent_get_dtstart (icalcomp); - dtstart_old = icalcomponent_get_dtstart (icalcomp_old); + dtstart = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); + dtstart_old = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp_old, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); dt_start_changed = icaltime_compare (dtstart, dtstart_old) != 0; if (dtstart.zone != NULL) { tzid_start = (icaltimezone *) dtstart.zone; @@ -1526,8 +1546,8 @@ dt_start_changed_timezone_name = TRUE; } - dtend = icalcomponent_get_dtend (icalcomp); - dtend_old = icalcomponent_get_dtend (icalcomp_old); + dtend = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTEND_PROPERTY, icalproperty_get_dtend); + dtend_old = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp_old, ICAL_DTEND_PROPERTY, icalproperty_get_dtend); dt_end_changed = icaltime_compare (dtend, dtend_old) != 0; if (dtend.zone != NULL) { tzid_end = (icaltimezone *) dtend.zone; @@ -1600,7 +1620,7 @@ e_ews_collect_attendees (icalcomp, &required, &optional, &resource, &rsvp_requested); - e_ews_message_write_string_parameter (msg, "IsResponseRequested", NULL, rsvp_requested ? "true" : "false"); + convert_vevent_property_to_updatexml (msg, "IsResponseRequested", rsvp_requested ? "true" : "false", "calendar", NULL, NULL); if (required != NULL) { e_ews_message_start_set_item_field (msg, "RequiredAttendees", "calendar", "CalendarItem"); @@ -1743,7 +1763,7 @@ prop = icalcomponent_get_first_property (icalcomp, ICAL_DUE_PROPERTY); if (prop) { - dt = icalproperty_get_due (prop); + dt = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DUE_PROPERTY, icalproperty_get_due); e_ews_message_start_set_item_field (msg, "DueDate", "task", "Task"); e_ews_cal_utils_set_time (msg, "DueDate", &dt, TRUE); e_ews_message_end_set_item_field (msg); @@ -1762,7 +1782,7 @@ prop = icalcomponent_get_first_property (icalcomp, ICAL_DTSTART_PROPERTY); if (prop) { - dt = icalproperty_get_dtstart (prop); + dt = e_cal_backend_ews_get_datetime_with_zone (convert_data->timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); e_ews_message_start_set_item_field (msg, "StartDate", "task", "Task"); e_ews_cal_utils_set_time (msg, "StartDate", &dt, TRUE); e_ews_message_end_set_item_field (msg); @@ -1791,6 +1811,14 @@ /* Categories */ convert_component_categories_to_updatexml (convert_data->comp, msg, "Task"); + prop = icalcomponent_get_first_property (icalcomp, ICAL_PRIORITY_PROPERTY); + if (prop) { + gint priority; + + priority = icalproperty_get_priority (prop); + convert_vtodo_property_to_updatexml (msg, "Importance", ews_priority_to_string (priority), "item", NULL, NULL); + } + e_ews_message_end_item_change (msg); } @@ -1975,3 +2003,41 @@ /* end of "AcceptItem" */ e_soap_message_end_element (msg); } + +struct icaltimetype +e_cal_backend_ews_get_datetime_with_zone (ETimezoneCache *timezone_cache, + icalcomponent *comp, + icalproperty_kind prop_kind, + struct icaltimetype (* get_func) (const icalproperty *prop)) +{ + struct icaltimetype dt = icaltime_null_time (); + icalproperty *prop; + icalparameter *param; + const gchar *tzid; + + g_return_val_if_fail (E_IS_TIMEZONE_CACHE (timezone_cache), dt); + g_return_val_if_fail (comp != NULL, dt); + g_return_val_if_fail (get_func != NULL, dt); + + prop = icalcomponent_get_first_property (comp, prop_kind); + if (!prop) + return dt; + + dt = get_func (prop); + + if (!icaltime_is_valid_time (dt) || + icaltime_is_null_time (dt)) + return dt; + + param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); + if (!param) + return dt; + + tzid = icalparameter_get_tzid (param); + if (!tzid || !*tzid) + return dt; + + dt.zone = e_timezone_cache_get_timezone (timezone_cache, tzid); + + return dt; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews-utils.h new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews-utils.h --- old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews-utils.h 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews-utils.h 2018-07-16 14:18:12.000000000 +0200 @@ -39,6 +39,7 @@ typedef struct { EEwsConnection *connection; + ETimezoneCache *timezone_cache; icaltimezone *default_zone; gchar *user_email; gchar *response_type; /* Accept */ @@ -79,6 +80,12 @@ guint e_cal_backend_ews_rid_to_index (icaltimezone *timezone, const gchar *rid, icalcomponent *comp, GError **error); +struct icaltimetype + e_cal_backend_ews_get_datetime_with_zone (ETimezoneCache *timezone_cache, + icalcomponent *comp, + icalproperty_kind prop_kind, + struct icaltimetype (* get_func) (const icalproperty *prop)); + G_END_DECLS #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews.c new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews.c --- old/evolution-ews-3.28.3/src/calendar/e-cal-backend-ews.c 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/calendar/e-cal-backend-ews.c 2018-07-16 14:18:12.000000000 +0200 @@ -87,6 +87,7 @@ " calendar:Resources" \ " calendar:ModifiedOccurrences" \ " calendar:IsMeeting" \ + " calendar:IsResponseRequested" \ " calendar:MyResponseType" \ " calendar:RequiredAttendees" \ " calendar:OptionalAttendees" @@ -578,7 +579,7 @@ if (start_zone != NULL) { icalcomp = icalcomponent_get_first_component (vcomp, kind); - dt = icalcomponent_get_dtstart (icalcomp); + dt = e_cal_backend_ews_get_datetime_with_zone (timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); dt = icaltime_convert_to_zone (dt, start_zone); icalcomponent_set_dtstart (icalcomp, dt); @@ -586,7 +587,7 @@ e_timezone_cache_add_timezone (timezone_cache, start_zone); if (end_zone != NULL) { - dt = icalcomponent_get_dtend (icalcomp); + dt = e_cal_backend_ews_get_datetime_with_zone (timezone_cache, icalcomp, ICAL_DTEND_PROPERTY, icalproperty_get_dtend); dt = icaltime_convert_to_zone (dt, end_zone); icalcomponent_set_dtend (icalcomp, dt); @@ -654,11 +655,11 @@ zone = icaltimezone_get_builtin_timezone (tzid); if (zone != NULL) { - dt = icalcomponent_get_dtstart (icalcomp); + dt = e_cal_backend_ews_get_datetime_with_zone (timezone_cache, icalcomp, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); dt = icaltime_convert_to_zone (dt, zone); icalcomponent_set_dtstart (icalcomp, dt); - dt = icalcomponent_get_dtend (icalcomp); + dt = e_cal_backend_ews_get_datetime_with_zone (timezone_cache, icalcomp, ICAL_DTEND_PROPERTY, icalproperty_get_dtend); dt = icaltime_convert_to_zone (dt, zone); icalcomponent_set_dtend (icalcomp, dt); } @@ -679,6 +680,7 @@ item_id = e_ews_item_get_id (item); if (e_ews_item_get_is_meeting (item)) { + gboolean is_response_requested = e_ews_item_get_is_response_requested (item); gchar *user_email; user_email = camel_ews_settings_dup_email (ews_settings); @@ -718,6 +720,11 @@ icalproperty_add_parameter (icalprop, cu_type); icalproperty_add_parameter (icalprop, param); + if (is_response_requested) { + param = icalparameter_new_rsvp (ICAL_RSVP_TRUE); + icalproperty_add_parameter (icalprop, param); + } + if (user_email && (email || attendee->mailbox->email) && e_ews_item_get_my_response_type (item) && g_ascii_strcasecmp (email ? email : attendee->mailbox->email, user_email) == 0) { param = ecb_ews_responsetype_to_partstat (e_ews_item_get_my_response_type (item)); @@ -1042,32 +1049,25 @@ for (link = items; link; link = g_slist_next (link)) { EEwsItem *item = link->data; + ECalComponent *comp; + GError *local_error = NULL; - if (!item) + if (!item || e_ews_item_get_item_type (item) == E_EWS_ITEM_TYPE_ERROR) continue; - if (e_ews_item_get_item_type (item) == E_EWS_ITEM_TYPE_ERROR) { - g_propagate_error (error, g_error_copy (e_ews_item_get_error (item))); + comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, &local_error); + if (!comp) { + if (!local_error) + continue; + + g_propagate_error (error, local_error); success = FALSE; break; - } else { - ECalComponent *comp; - GError *local_error = NULL; - - comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, &local_error); - if (!comp) { - if (!local_error) - continue; - - g_propagate_error (error, local_error); - success = FALSE; - break; - } + } - ecb_ews_store_original_comp (comp); + ecb_ews_store_original_comp (comp); - *out_components = g_slist_prepend (*out_components, comp); - } + *out_components = g_slist_prepend (*out_components, comp); } exit: @@ -2447,6 +2447,7 @@ ews_settings = ecb_ews_get_collection_settings (cbews); convert_data.connection = cbews->priv->cnc; + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); convert_data.user_email = camel_ews_settings_dup_email (ews_settings); convert_data.comp = comp; convert_data.old_comp = oldcomp; @@ -2628,6 +2629,7 @@ } convert_data.connection = cbews->priv->cnc; + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); convert_data.icalcomp = icalcomp; convert_data.default_zone = icaltimezone_get_utc_timezone (); @@ -2843,6 +2845,8 @@ return; } + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); + if (e_cal_component_has_recurrences (comp)) { gint *index; @@ -2926,7 +2930,7 @@ icalcomponent_add_property (vevent, icalproperty_new_status (ICAL_STATUS_CANCELLED)); prop = icalcomponent_get_first_property (vevent, ICAL_METHOD_PROPERTY); if (prop != NULL) icalcomponent_remove_property (vevent, prop); - dt = icalcomponent_get_dtstart (vevent); + dt = e_cal_backend_ews_get_datetime_with_zone (E_TIMEZONE_CACHE (cbews), vevent, ICAL_DTSTART_PROPERTY, icalproperty_get_dtstart); icaltz = (icaltimezone *) (dt.zone ? dt.zone : ecb_ews_get_timezone_from_ical_component (cbews, vevent)); vtz = icaltimezone_get_component (icaltz); @@ -2978,6 +2982,7 @@ EwsFolderId *fid; convert_data.connection = cbews->priv->cnc; + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); convert_data.icalcomp = subcomp; convert_data.default_zone = icaltimezone_get_utc_timezone (); @@ -3257,6 +3262,7 @@ } else { EwsCalendarConvertData convert_data = { 0 }; + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); convert_data.response_type = (gchar *) response_type; convert_data.item_id = item_id; convert_data.change_key = change_key; @@ -3360,6 +3366,8 @@ } } + convert_data.timezone_cache = E_TIMEZONE_CACHE (cbews); + e_ews_connection_update_items_sync ( cbews->priv->cnc, EWS_PRIORITY_MEDIUM, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/camel/camel-ews-folder.c new/evolution-ews-3.28.4/src/camel/camel-ews-folder.c --- old/evolution-ews-3.28.3/src/camel/camel-ews-folder.c 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/camel/camel-ews-folder.c 2018-07-16 14:18:12.000000000 +0200 @@ -1775,6 +1775,14 @@ CamelFolder *folder; CamelFolderSummary *folder_summary; CamelEwsFolder *ews_folder; + CamelSettings *settings; + gboolean filter_inbox = FALSE; + gboolean filter_junk = FALSE; + gboolean filter_junk_inbox = FALSE; + gboolean offline_limit_by_age = FALSE; + CamelTimeUnit offline_limit_unit; + gint offline_limit_value = 0; + guint32 add_folder_flags = 0; gchar *state_file; const gchar *short_name; @@ -1801,6 +1809,20 @@ return NULL; } + settings = camel_service_ref_settings (CAMEL_SERVICE (store)); + + g_object_get ( + settings, + "filter-inbox", &filter_inbox, + "filter-junk", &filter_junk, + "filter-junk-inbox", &filter_junk_inbox, + "limit-by-age", &offline_limit_by_age, + "limit-unit", &offline_limit_unit, + "limit-value", &offline_limit_value, + NULL); + + g_clear_object (&settings); + camel_folder_take_folder_summary (folder, folder_summary); /* set/load persistent state */ @@ -1816,23 +1838,8 @@ } if (camel_offline_folder_can_downsync (CAMEL_OFFLINE_FOLDER (folder))) { - CamelSettings *settings; - gboolean offline_limit_by_age = FALSE; - CamelTimeUnit offline_limit_unit; - gint offline_limit_value; time_t when = (time_t) 0; - settings = camel_service_ref_settings (CAMEL_SERVICE (store)); - - g_object_get ( - settings, - "limit-by-age", &offline_limit_by_age, - "limit-unit", &offline_limit_unit, - "limit-value", &offline_limit_value, - NULL); - - g_clear_object (&settings); - if (offline_limit_by_age) when = camel_time_value_apply (when, offline_limit_unit, offline_limit_value); @@ -1855,20 +1862,21 @@ if (!g_ascii_strcasecmp (folder_name, "Inbox") || folder_has_inbox_type (CAMEL_EWS_STORE (store), folder_name)) { - CamelSettings *settings; - gboolean filter_inbox; - settings = camel_service_ref_settings (CAMEL_SERVICE (store)); - filter_inbox = camel_store_settings_get_filter_inbox ( - CAMEL_STORE_SETTINGS (settings)); - if (filter_inbox) - camel_folder_set_flags (folder, camel_folder_get_flags (folder) | CAMEL_FOLDER_FILTER_RECENT); + add_folder_flags |= CAMEL_FOLDER_FILTER_RECENT; - g_object_unref (settings); + if (filter_junk) + add_folder_flags |= CAMEL_FOLDER_FILTER_JUNK; + } else { + if (filter_junk && !filter_junk_inbox) + add_folder_flags |= CAMEL_FOLDER_FILTER_JUNK; } + if (add_folder_flags) + camel_folder_set_flags (folder, camel_folder_get_flags (folder) | add_folder_flags); + ews_folder->search = camel_ews_search_new (CAMEL_EWS_STORE (store)); if (!ews_folder->search) { g_object_unref (folder); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/server/e-ews-item.c new/evolution-ews-3.28.4/src/server/e-ews-item.c --- old/evolution-ews-3.28.3/src/server/e-ews-item.c 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/server/e-ews-item.c 2018-07-16 14:18:12.000000000 +0200 @@ -113,6 +113,7 @@ time_t date_received; time_t date_sent; time_t date_created; + time_t last_modified_time; gsize size; gchar *msg_id; @@ -138,6 +139,7 @@ EwsMailbox *sender; gboolean is_meeting; + gboolean is_response_requested; GSList *modified_occurrences; GSList *attachments_ids; gchar *my_response_type; @@ -281,6 +283,7 @@ item->priv->item_type = E_EWS_ITEM_TYPE_UNKNOWN; item->priv->is_meeting = FALSE; + item->priv->is_response_requested = FALSE; item->priv->mapi_extended_tags = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); item->priv->mapi_extended_sets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_destroy); @@ -1075,6 +1078,10 @@ value = e_soap_parameter_get_string_value (subparam); priv->date_created = ews_item_parse_date (value); g_free (value); + } else if (!g_ascii_strcasecmp (name, "LastModifiedTime")) { + value = e_soap_parameter_get_string_value (subparam); + priv->last_modified_time = ews_item_parse_date (value); + g_free (value); } else if (!g_ascii_strcasecmp (name, "HasAttachments")) { value = e_soap_parameter_get_string_value (subparam); priv->has_attachments = (!g_ascii_strcasecmp (value, "true")); @@ -1140,6 +1147,10 @@ value = e_soap_parameter_get_string_value (subparam); priv->is_meeting = (!g_ascii_strcasecmp (value, "true")); g_free (value); + } else if (!g_ascii_strcasecmp (name, "IsResponseRequested")) { + value = e_soap_parameter_get_string_value (subparam); + priv->is_response_requested = (!g_ascii_strcasecmp (value, "true")); + g_free (value); } else if (!g_ascii_strcasecmp (name, "MyResponseType")) { g_free (priv->my_response_type); priv->my_response_type = e_soap_parameter_get_string_value (subparam); @@ -1367,6 +1378,14 @@ return item->priv->date_created; } +time_t +e_ews_item_get_last_modified_time (EEwsItem *item) +{ + g_return_val_if_fail (E_IS_EWS_ITEM (item), -1); + + return item->priv->last_modified_time; +} + gboolean e_ews_item_has_attachments (EEwsItem *item, gboolean *has_attachments) @@ -1398,6 +1417,14 @@ } gboolean +e_ews_item_get_is_response_requested (EEwsItem *item) +{ + g_return_val_if_fail (E_IS_EWS_ITEM (item), FALSE); + + return item->priv->is_response_requested; +} + +gboolean e_ews_item_is_forwarded (EEwsItem *item, gboolean *forwarded) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.28.3/src/server/e-ews-item.h new/evolution-ews-3.28.4/src/server/e-ews-item.h --- old/evolution-ews-3.28.3/src/server/e-ews-item.h 2018-06-18 11:18:59.000000000 +0200 +++ new/evolution-ews-3.28.4/src/server/e-ews-item.h 2018-07-16 14:18:12.000000000 +0200 @@ -190,6 +190,8 @@ time_t e_ews_item_get_date_received (EEwsItem *item); time_t e_ews_item_get_date_sent (EEwsItem *item); time_t e_ews_item_get_date_created (EEwsItem *item); +time_t e_ews_item_get_last_modified_time + (EEwsItem *item); gboolean e_ews_item_has_attachments (EEwsItem *item, gboolean *has_attachments); gboolean e_ews_item_is_read (EEwsItem *item, @@ -216,6 +218,8 @@ void e_ews_mailbox_free (EwsMailbox *mailbox); gboolean e_ews_item_get_is_meeting (EEwsItem *item); +gboolean e_ews_item_get_is_response_requested + (EEwsItem *item); const GSList * e_ews_item_get_modified_occurrences (EEwsItem *item); gchar * e_ews_embed_attachment_id_in_uri (const gchar *olduri, const gchar *attach_id);
