[evolution-ews] handle a situation where bot value and old value are NULL while modifying a meeting
- From: Shiran Stan-Meleh <sstanmel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] handle a situation where bot value and old value are NULL while modifying a meeting
- Date: Sun, 14 Aug 2011 09:11:59 +0000 (UTC)
commit bfbe4ce9fcd637e59d383cb4ac8dac84419c8ff8
Author: Shiran Stan-Meleh <shiran stan-meleh intel com>
Date: Sun Aug 14 11:46:17 2011 +0300
handle a situation where bot value and old value are NULL while modifying a meeting
src/calendar/e-cal-backend-ews.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index ca0343c..1f0d5ce 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -1699,18 +1699,20 @@ convert_vevent_component_to_updatexml(ESoapMessage *msg, gpointer user_data)
/* subject */
value = icalcomponent_get_summary (icalcomp);
old_value = icalcomponent_get_summary (icalcomp_old);
- 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);
+ if ((value && old_value && g_ascii_strcasecmp (value, old_value)) ||
+ (value && old_value == NULL)) {
+ convert_vevent_property_to_updatexml (msg, "Subject", value, "item", NULL, NULL);
+ } else if (!value && old_value)
+ convert_vevent_property_to_updatexml (msg, "Subject", "", "item", NULL, NULL);
/*description*/
value = icalcomponent_get_description (icalcomp);
old_value = icalcomponent_get_description (icalcomp_old);
- 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");
+ if ((value && old_value && g_ascii_strcasecmp (value, old_value)) ||
+ (value && old_value == NULL)) {
+ convert_vevent_property_to_updatexml (msg, "Body", "", "item", "BodyType", "Text");
+ } else if (!value && old_value)
+ convert_vevent_property_to_updatexml (msg, "Body", value, "item", "BodyType", "Text");
/*update alarm items*/
has_alarms = e_cal_component_has_alarms (modify_data->comp);
@@ -1730,10 +1732,11 @@ convert_vevent_component_to_updatexml(ESoapMessage *msg, gpointer user_data)
/*location*/
value = icalcomponent_get_location (icalcomp);
old_value = icalcomponent_get_location (icalcomp_old);
- 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);
+ if ((value && old_value && g_ascii_strcasecmp (value, old_value)) ||
+ (value && old_value == NULL)) {
+ convert_vevent_property_to_updatexml (msg, "Location", "", "calendar", NULL, NULL);
+ } else if (!value && old_value)
+ convert_vevent_property_to_updatexml (msg, "Location", value, "calendar", NULL, NULL);
/*freebusy*/
transp = icalcomponent_get_first_property (icalcomp, ICAL_TRANSP_PROPERTY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]