Updated patch attached.  No longer requires the libical patch.

-JP
-- 
--
=======================================================================
JP Rosevear                             [EMAIL PROTECTED]
Ximian Inc.                             http://www.ximian.com
? free-busy-utc.patch
? meeting-tz.patch
? default-uri.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1260
diff -u -r1.1260 ChangeLog
--- ChangeLog   2001/11/09 03:05:48     1.1260
+++ ChangeLog   2001/11/09 17:20:36
@@ -1,3 +1,10 @@
+2001-11-07  JP Rosevear  <[EMAIL PROTECTED]>
+
+       * pcs/cal-backend-file.c (free_busy_instance): recurrence
+       expansion callback for free/busy
+       (create_user_free_busy): expand recurrences and use date/time
+       values for dtstart and dtend
+
 2001-11-08  JP Rosevear  <[EMAIL PROTECTED]>
 
        * gui/e-meeting-time-sel.c
@@ -24,7 +31,7 @@
        Convert generated string to UTF-8.
 
 2001-11-07  JP Rosevear  <[EMAIL PROTECTED]>
-
+       
        * gui/e-meeting-time-sel.c
        (e_meeting_time_selector_on_start_time_changed): emit changed
        signal
Index: pcs/cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/pcs/cal-backend-file.c,v
retrieving revision 1.55
diff -u -r1.55 cal-backend-file.c
--- pcs/cal-backend-file.c      2001/11/08 18:29:07     1.55
+++ pcs/cal-backend-file.c      2001/11/09 17:20:37
@@ -1217,6 +1217,36 @@
        return event_list;
 }
 
+static gboolean
+free_busy_instance (CalComponent *comp,
+                   time_t        instance_start,
+                   time_t        instance_end,
+                   gpointer      data)
+{
+       icalcomponent *vfb = data;
+       icalproperty *prop;
+       icalparameter *param;
+       struct icalperiodtype ipt;
+       icaltimezone *utc_zone;
+
+       utc_zone = icaltimezone_get_utc_timezone ();
+
+       ipt.start = icaltime_from_timet_with_zone (instance_start, FALSE, utc_zone);
+       ipt.end = icaltime_from_timet_with_zone (instance_end, FALSE, utc_zone);
+       ipt.duration = icaldurationtype_null_duration ();
+       
+        /* add busy information to the vfb component */
+       prop = icalproperty_new (ICAL_FREEBUSY_PROPERTY);
+       icalproperty_set_freebusy (prop, ipt);
+       
+       param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY);
+       icalproperty_add_parameter (prop, param);
+       
+       icalcomponent_add_property (vfb, prop);
+
+       return TRUE;
+}
+
 static icalcomponent *
 create_user_free_busy (CalBackendFile *cbfile, const char *address, const char *cn,
                       time_t start, time_t end)
@@ -1225,7 +1255,8 @@
        GList *uids;
        GList *l;
        icalcomponent *vfb;
-
+       icaltimezone *utc_zone;
+       
        priv = cbfile->priv;
 
        /* create the (unique) VFREEBUSY object that we'll return */
@@ -1242,8 +1273,9 @@
                if (prop != NULL)
                        icalcomponent_add_property (vfb, prop);         
        }
-       icalcomponent_set_dtstart (vfb, icaltime_from_timet (start, 1));
-       icalcomponent_set_dtend (vfb, icaltime_from_timet (end, 1));
+       utc_zone = icaltimezone_get_utc_timezone ();
+       icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, 
+utc_zone));
+       icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, 
+utc_zone));
 
        /* add all objects in the given interval */
 
@@ -1251,10 +1283,8 @@
                                                 CALOBJ_TYPE_ANY, start, end);
        for (l = uids; l != NULL; l = l->next) {
                CalComponent *comp;
-               icalcomponent *icalcomp;
-               icalparameter *param;
+               icalcomponent *icalcomp, *vcalendar_comp;
                icalproperty *prop;
-               struct icalperiodtype ipt;
                char *uid = (char *) l->data;
 
                /* get the component from our internal list */
@@ -1276,18 +1306,14 @@
                                continue;
                }
 
-               ipt.start = icalcomponent_get_dtstart (icalcomp);
-               ipt.end = icalcomponent_get_dtend (icalcomp);
-               ipt.duration = icalcomponent_get_duration (icalcomp);
-
-               /* add busy information to the vfb component */
-               prop = icalproperty_new (ICAL_FREEBUSY_PROPERTY);
-               icalproperty_set_freebusy (prop, ipt);
-
-               param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY);
-               icalproperty_add_parameter (prop, param);
-
-               icalcomponent_add_property (vfb, prop);
+               vcalendar_comp = icalcomponent_get_parent (icalcomp);
+               cal_recur_generate_instances (comp, start, end,
+                                             free_busy_instance,
+                                             vfb,
+                                             resolve_tzid,
+                                             vcalendar_comp,
+                                             priv->default_zone);
+               
        }
        cal_obj_uid_list_free (uids);
 


Reply via email to