]> code.citadel.org Git - citadel.git/blobdiff - webcit/event.c
* collect sender / read / unread information for calendar items
[citadel.git] / webcit / event.c
index d904924b0d63b7138b8177fd6a0e75d3056b52d6..000e070f758ea661ae47143d5068973f3ce366cb 100644 (file)
@@ -17,7 +17,7 @@
  * \param supplied_vevent the event to edit
  * \param msgnum reference on the citserver
  */
-void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) {
+void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread) {
        icalcomponent *vevent;
        icalproperty *p;
        icalvalue *v;
@@ -34,6 +34,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        int i;
        int sequence = 0;
 
+       lprintf(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n",
+               msgnum, bstr("calview"), bstr("year"), bstr("month"), bstr("day")
+       );
+
        now = time(NULL);
        strcpy(organizer_string, "");
        strcpy(attendee_string, "");
@@ -51,8 +55,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                if (icalcomponent_isa(vevent) == ICAL_VCALENDAR_COMPONENT) {
                        display_edit_individual_event(
                                icalcomponent_get_first_component(
-                                       vevent, ICAL_VEVENT_COMPONENT
-                               ), msgnum
+                                       vevent, ICAL_VEVENT_COMPONENT), 
+                               msgnum, from, unread
                        );
                        return;
                }
@@ -233,7 +237,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                         * from the start time.
                         */
                        t_end = t_start;
-                       t_end.hour += 0;
+                       t_end.hour += 1;
                        t_end.second = 0;
                        t_end = icaltime_normalize(t_end);
                        /* t_end = icaltime_from_timet(now, 0); */
@@ -424,7 +428,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
  * \param supplied_vevent the event to save
  * \param msgnum the index on the citserver
  */
-void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
+void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread) {
        char buf[SIZ];
        icalproperty *prop;
        icalcomponent *vevent, *encaps;
@@ -453,8 +457,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                if (icalcomponent_isa(vevent) == ICAL_VCALENDAR_COMPONENT) {
                        save_individual_event(
                                icalcomponent_get_first_component(
-                                       vevent, ICAL_VEVENT_COMPONENT
-                               ), msgnum
+                                       vevent, ICAL_VEVENT_COMPONENT), 
+                               msgnum, from, unread
                        );
                        return;
                }
@@ -706,6 +710,7 @@ STARTOVER:  for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE
                        if (buf[0] == '2') {
                                strcpy(WC->ImportantMessage, &buf[4]);
                        }
+                       icalmemory_free_ring ();
                        icalcomponent_free(encaps);
                }
 
@@ -716,7 +721,7 @@ STARTOVER:  for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE
                        check_attendee_availability(encaps);
 
                        /** This displays the form again, with our annotations */
-                       display_edit_individual_event(encaps, msgnum);
+                       display_edit_individual_event(encaps, msgnum, from, unread);
 
                        icalcomponent_free(encaps);
                }