summaryrefslogtreecommitdiff
path: root/calendar/backends
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2004-03-18 23:54:34 +0000
committerRodrigo Moya <rodrigo@src.gnome.org>2004-03-18 23:54:34 +0000
commit1abd32a0a7ea93919b922212bcd1e3c085d3bf97 (patch)
tree08e2c56cfc386832156d34ca6212f834ad709ccc /calendar/backends
parent51d4d5f45963726937eeb58990edf1dd185f6659 (diff)
downloadevolution-data-server-1abd32a0a7ea93919b922212bcd1e3c085d3bf97.tar.gz
set the GW item ID based on the X-EVOLUTION-GROUPWISE-ID property.
2004-03-18 Rodrigo Moya <rodrigo@ximian.com> * backends/groupwise/e-cal-backend-groupwise-utils.c (set_properties_from_cal_component): set the GW item ID based on the X-EVOLUTION-GROUPWISE-ID property. (e_gw_item_to_cal_component): add the above property to the created ECalComponent, and use our iCalendar ID to set the "iCalId" property.
Diffstat (limited to 'calendar/backends')
-rw-r--r--calendar/backends/groupwise/e-cal-backend-groupwise-utils.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
index 1c0a02479..6a81f8aa3 100644
--- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
+++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
@@ -36,6 +36,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp)
ECalComponentText text;
int *priority;
GSList *slist, *sl;
+ icalproperty *prop;
/* first set specific properties */
switch (e_cal_component_get_vtype (comp)) {
@@ -98,9 +99,26 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp)
}
/* set common properties */
+ /* GW server ID */
+ prop = icalcomponent_get_first_property (e_cal_component_get_icalcomponent (comp),
+ ICAL_X_PROPERTY);
+ while (prop) {
+ const char *x_name, *x_val;
+
+ x_name = icalproperty_get_x_name (prop);
+ x_val = icalproperty_get_x (prop);
+ if (!strcmp (x_name, "X-EVOLUTION-GROUPWISE-ID")) {
+ e_gw_item_set_id (item, x_val);
+ break;
+ }
+
+ prop = icalcomponent_get_next_property (e_cal_component_get_icalcomponent (comp),
+ ICAL_X_PROPERTY);
+ }
+
/* UID */
e_cal_component_get_uid (comp, &uid);
- e_gw_item_set_id (item, uid);
+ e_gw_item_set_icalid (item, uid);
/* subject */
e_cal_component_get_summary (comp, &text);
@@ -211,8 +229,18 @@ e_gw_item_to_cal_component (EGwItem *item)
}
/* set common properties */
+ /* GW server ID */
+ description = e_gw_item_get_id (item);
+ if (description) {
+ icalproperty *icalprop;
+
+ icalprop = icalproperty_new_x (description);
+ icalproperty_set_x_name (icalprop, "X-EVOLUTION-GROUPWISE-ID");
+ icalcomponent_add_property (e_cal_component_get_icalcomponent (comp), icalprop);
+ }
+
/* UID */
- e_cal_component_set_uid (comp, e_gw_item_get_id (item));
+ e_cal_component_set_uid (comp, e_gw_item_get_icalid (item));
/* summary */
text.value = e_gw_item_get_subject (item);