Codebase list evolution-ews / 6b66c52
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. Milan Crha 4 years ago
1 changed file(s) with 10 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
14831483
14841484 categ_list = e_cal_component_get_categories_list (comp);
14851485
1486 /* Categories cannot be empty, thus first verify they are not */
1486 e_ews_message_start_set_item_field (msg, "Categories", "item", base_elem_name);
1487 e_soap_message_start_element (msg, "Categories", NULL, NULL);
14871488
14881489 for (citer = categ_list; citer; citer = g_slist_next (citer)) {
14891490 const gchar *category = citer->data;
14901491
1491 if (category && *category)
1492 break;
1493 }
1494
1495 if (citer) {
1496 e_ews_message_start_set_item_field (msg, "Categories", "item", base_elem_name);
1497 e_soap_message_start_element (msg, "Categories", NULL, NULL);
1498
1499 for (citer = categ_list; citer; citer = g_slist_next (citer)) {
1500 const gchar *category = citer->data;
1501
1502 if (!category || !*category)
1503 continue;
1504
1505 e_ews_message_write_string_parameter (msg, "String", NULL, category);
1506 }
1507
1508 e_soap_message_end_element (msg); /* Categories */
1509 e_ews_message_end_set_item_field (msg);
1510 } else {
1511 e_ews_message_add_delete_item_field (msg, "Categories", "item");
1512 }
1492 if (!category || !*category)
1493 continue;
1494
1495 e_ews_message_write_string_parameter (msg, "String", NULL, category);
1496 }
1497
1498 e_soap_message_end_element (msg); /* Categories */
1499 e_ews_message_end_set_item_field (msg);
15131500
15141501 g_slist_free_full (categ_list, g_free);
15151502 }