]> code.citadel.org Git - citadel.git/commitdiff
* Moved the calendar meeting request reply functionality to the Citadel server
authorArt Cancro <ajc@citadel.org>
Sat, 19 Oct 2002 21:28:32 +0000 (21:28 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 19 Oct 2002 21:28:32 +0000 (21:28 +0000)
webcit/ChangeLog
webcit/calendar.c

index a2619e92ba0f7f02d182d1a8cbdb60e18066a4bf..d4d3e12acc42b98e6aa593369c144854ba78efd7 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 400.42  2002/10/19 21:28:32  ajc
+* Moved the calendar meeting request reply functionality to the Citadel server
+
 Revision 400.41  2002/10/19 17:10:14  ajc
 * Add "Tentative" accept button
 * Only display Accept/Tentative/Decline button when method=REQUEST
@@ -1081,4 +1084,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 64f977d6fee1573c64c708ee0c185a33a31d2b8f..2cdab8f77cd9a710dda8d6a8ceaa0d9c98724cd4 100644 (file)
@@ -210,69 +210,6 @@ void cal_process_object(icalcomponent *cal,
 }
 
 
-/*
- * Back end for cal_add() -- this writes it to the message base
- */
-void pencil_it_in(icalcomponent *cal) {
-       char hold_rm[SIZ];
-       char buf[SIZ];
-       char *serialized_event;
-
-       /* Save the name of the room we're in */
-       strcpy(hold_rm, WC->wc_roomname);
-
-       /* Go find the user's calendar */
-       serv_printf("GOTO %s", CALENDAR_ROOM_NAME);
-       serv_gets(buf);
-       if (buf[0] != '2') return;
-
-       /* Enter the message */
-       serialized_event = icalcomponent_as_ical_string(cal);
-       if (serialized_event != NULL) {
-               sprintf(buf, "ENT0 1|||4||");
-               serv_puts(buf);
-               serv_gets(buf);
-               if (buf[0] == '4') {
-                       serv_puts("Content-type: text/calendar");
-                       serv_puts("");
-                       serv_write(serialized_event, strlen(serialized_event));
-                       serv_puts("");
-                       serv_puts("000");
-               }
-       }
-
-       /* Return to the room we were in */
-       serv_printf("GOTO %s", hold_rm);
-       serv_gets(buf);
-}
-
-
-/*
- * Add a calendar object to the user's calendar
- */
-void cal_add(icalcomponent *cal, int recursion_level, int tentative) {
-       icalcomponent *c;
-
-       /*
-        * The VEVENT subcomponent is the one we're interested in saving.
-        */
-       if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
-               /* Save to the message base */
-               pencil_it_in(cal);
-
-       }
-
-       /* If the component has subcomponents, recurse through them. */
-       for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
-           (c != 0);
-           c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
-               /* Recursively process subcomponent */
-               cal_add(c, recursion_level+1, tentative);
-       }
-
-}
-
-
 /*
  * Deserialize a calendar object in a message so it can be processed.
  * (This is the main entry point for these things)
@@ -302,9 +239,6 @@ void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
  */
 void respond_to_request(void) {
        char buf[SIZ];
-       size_t total_len;
-       char *serialized_cal;
-       icalcomponent *cal;
 
        output_headers(3);
 
@@ -314,56 +248,14 @@ void respond_to_request(void) {
                "</FONT></TD></TR></TABLE><BR>\n"
        );
 
-       sprintf(buf, "OPNA %s|%s", bstr("msgnum"), bstr("cal_partnum"));
-       serv_puts(buf);
-       serv_gets(buf);
-       if (buf[0] != '2') {
-               wprintf("Error: %s<BR>\n", &buf[4]);
-               wDumpContent(1);
-               return;
-       }
-
-       total_len = atoi(&buf[4]);
-       serialized_cal = malloc(total_len + 1);
-
-       read_server_binary(serialized_cal, total_len);
-
-       serv_puts("CLOS");
+       serv_printf("ICAL respond|%s|%s|%s|",
+               bstr("msgnum"),
+               bstr("cal_partnum"),
+               bstr("sc")
+       );
        serv_gets(buf);
-       serialized_cal[total_len + 1] = 0;
-
-       /* Deserialize it */
-       cal = icalcomponent_new_from_string(serialized_cal);
-       free(serialized_cal);
-
-       if (cal == NULL) {
-               wprintf("Error parsing calendar object: %s<BR>\n",
-                       icalerror_strerror(icalerrno));
-               wDumpContent(1);
-               return;
-       }
-
-       /* Save this in the user's calendar if necessary */
-       if (!strcasecmp(bstr("sc"), "Accept")) {
-               cal_add(cal, 0, 0);
-       }
-       if (!strcasecmp(bstr("sc"), "Tentative")) {
-               cal_add(cal, 0, 1);
-       }
-
-       /* Send a reply if necessary */
-       /* FIXME ... do this */
-
-       /* Free the memory we obtained from libical's constructor */
-       icalcomponent_free(cal);
-
-       /* Delete the message from the inbox */
-       /* FIXME ... do this */
-
-
-       wprintf("Done!<BR>\n");
+       escputs(buf);
 
-       /* ...and now we're done. */
        wDumpContent(1);
 }