[evolution-ews] Handle situation where there are no values in some fields when modifying a calendar item



commit 415760d8ade2ef8af215df1fc843f7b1b8501419
Author: Shiran Stan-Meleh <shiran stan-meleh intel com>
Date:   Tue Aug 9 17:57:18 2011 +0300

    Handle situation where there are no values in some fields when modifying a calendar item

 src/calendar/e-cal-backend-ews.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 26384bb..81d209e 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -1683,13 +1683,17 @@ convert_vevent_component_to_updatexml(ESoapMessage *msg, gpointer user_data)
 	/* subject */
 	value = icalcomponent_get_summary (icalcomp);
 	old_value = icalcomponent_get_summary (icalcomp_old);
-	if (g_ascii_strcasecmp (value, old_value))
+	if (value == NULL)
+		convert_vevent_property_to_updatexml (msg, "Subject", "", "item", NULL, NULL);
+	else if ((old_value ==  NULL) || g_ascii_strcasecmp (value, old_value))
 		convert_vevent_property_to_updatexml (msg, "Subject", value, "item", NULL, NULL);
 
 	/*description*/
 	value = icalcomponent_get_description (icalcomp);
 	old_value = icalcomponent_get_description (icalcomp_old);
-	if (g_ascii_strcasecmp (value, old_value))
+	if (value == NULL)
+		convert_vevent_property_to_updatexml (msg, "Body", "", "item", "BodyType", "Text");
+	else if ((old_value == NULL) || g_ascii_strcasecmp (value, old_value))
 		convert_vevent_property_to_updatexml (msg, "Body", value, "item", "BodyType", "Text");
 
 	/*update alarm items*/
@@ -1710,7 +1714,9 @@ convert_vevent_component_to_updatexml(ESoapMessage *msg, gpointer user_data)
 	/*location*/
 	value = icalcomponent_get_location (icalcomp);
 	old_value = icalcomponent_get_location (icalcomp_old);
-	if (g_ascii_strcasecmp (value, old_value))
+	if (value == NULL)
+		convert_vevent_property_to_updatexml (msg, "Location", "", "calendar", NULL, NULL);
+	else if ((old_value == NULL) || g_ascii_strcasecmp (value, old_value))
 		convert_vevent_property_to_updatexml (msg, "Location", value, "calendar", NULL, NULL);
 
 	/*freebusy*/



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