[evolution-ews] Categories property cannot be deleted



commit 6b66c52781c81dba27b37bfb47fd8fb0d8b86bb9
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 1 17:13:31 2019 +0200

    Categories property cannot be deleted
    
    When changing an existing event and setting no category to it,
    the backend tried to delete the Categories property, but it's not
    supported by the server, thus make a change to not error out in
    such case.

 src/calendar/e-cal-backend-ews-utils.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews-utils.c b/src/calendar/e-cal-backend-ews-utils.c
index 5781524f..4a2fa365 100644
--- a/src/calendar/e-cal-backend-ews-utils.c
+++ b/src/calendar/e-cal-backend-ews-utils.c
@@ -1484,34 +1484,21 @@ convert_component_categories_to_updatexml (ECalComponent *comp,
 
        categ_list = e_cal_component_get_categories_list (comp);
 
-       /* Categories cannot be empty, thus first verify they are not */
+       e_ews_message_start_set_item_field (msg, "Categories", "item", base_elem_name);
+       e_soap_message_start_element (msg, "Categories", NULL, NULL);
 
        for (citer = categ_list; citer; citer = g_slist_next (citer)) {
                const gchar *category = citer->data;
 
-               if (category && *category)
-                       break;
-       }
-
-       if (citer) {
-               e_ews_message_start_set_item_field (msg, "Categories", "item", base_elem_name);
-               e_soap_message_start_element (msg, "Categories", NULL, NULL);
-
-               for (citer = categ_list; citer; citer = g_slist_next (citer)) {
-                       const gchar *category = citer->data;
-
-                       if (!category || !*category)
-                               continue;
-
-                       e_ews_message_write_string_parameter (msg, "String", NULL, category);
-               }
+               if (!category || !*category)
+                       continue;
 
-               e_soap_message_end_element (msg); /* Categories */
-               e_ews_message_end_set_item_field (msg);
-       } else {
-               e_ews_message_add_delete_item_field (msg, "Categories", "item");
+               e_ews_message_write_string_parameter (msg, "String", NULL, category);
        }
 
+       e_soap_message_end_element (msg); /* Categories */
+       e_ews_message_end_set_item_field (msg);
+
        g_slist_free_full (categ_list, g_free);
 }
 


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