]> code.citadel.org Git - citadel.git/blobdiff - webcit/event.c
* Display PARTSTAT for attendees
[citadel.git] / webcit / event.c
index 446cfed7b832e1378543d9bc3711f29adffc6bca..45d1e2932f1b0751e017998a01633e4c727cd185 100644 (file)
@@ -48,7 +48,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        int organizer_is_me = 0;
        int sequence = 0;
 
-       now = time(NULL);
+       now = time(NULL) % 60;  /* mod 60 to force :00 seconds */
        strcpy(organizer_string, "");
        strcpy(attendee_string, "");
 
@@ -138,12 +138,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                if (strlen(bstr("hour")) > 0) {
                        t_start.hour = atoi(bstr("hour"));
                        t_start.minute = atoi(bstr("minute"));
+                       t_start.second = 0;
                }
                else {
                        t_start.hour = 9;
                        t_start.minute = 0;
+                       t_start.second = 0;
                }
-               /* t_start = icaltime_from_timet(now, 0); */
        }
        display_icaltimetype_as_webform(&t_start, "dtstart");
 
@@ -201,6 +202,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                         */
                        t_end = t_start;
                        t_end.hour += 1;
+                       t_end.second = 0;
                        t_end = icaltime_normalize(t_end);
                        /* t_end = icaltime_from_timet(now, 0); */
                }
@@ -279,10 +281,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY); attendee != NULL; attendee = icalcomponent_get_next_property(vevent, ICAL_ATTENDEE_PROPERTY)) {
                strcpy(attendee_string, icalproperty_get_attendee(attendee));
                if (!strncasecmp(attendee_string, "MAILTO:", 7)) {
+
+                       /* screen name or email address */
                        strcpy(attendee_string, &attendee_string[7]);
                        striplt(attendee_string);
                        if (i++) wprintf(", ");
                        escputs(attendee_string);
+                       wprintf(" ");
+
+                       /* participant status */
+                       partstat_as_string(buf, attendee);
+                       escputs(buf);
                }
        }
        wprintf("</TEXTAREA></TD></TR>\n");
@@ -490,7 +499,12 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                /*
                 * Add any new attendees listed in the web form
                 */
+
+               /* First, strip out the parenthesized partstats.  */
                strcpy(form_attendees, bstr("attendees"));
+               stripout(form_attendees, '(', ')');
+
+               /* Now iterate! */
                for (i=0; i<num_tokens(form_attendees, ','); ++i) {
                        extract_token(buf, form_attendees, i, ',');
                        striplt(buf);