Handle read-only rooms more gracefully when attempting
authorArt Cancro <ajc@citadel.org>
Fri, 26 May 2006 16:38:49 +0000 (16:38 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 26 May 2006 16:38:49 +0000 (16:38 +0000)
to post calendar items, etc.

webcit/event.c
webcit/messages.c

index 3490b79fbb79494954d74db3a407c9cc64932e77..af670ff5906bc7753c61bd7cb24d5f3f0512d336 100644 (file)
@@ -686,8 +686,13 @@ STARTOVER: lprintf(9, "Remove unlisted attendees\n");
                                serv_puts(icalcomponent_as_ical_string(encaps));
                                serv_puts("000");
                        }
-                       while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-                               lprintf(9, "ENT0 REPLY: %s\n", buf);
+                       if ( (buf[0] == '8') || (buf[0] == '4') ) {
+                               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                                       lprintf(9, "ENT0 REPLY: %s\n", buf);
+                               }
+                       }
+                       if (buf[0] == '2') {
+                               strcpy(WC->ImportantMessage, &buf[4]);
                        }
                        icalcomponent_free(encaps);
                }
@@ -719,7 +724,7 @@ STARTOVER:  lprintf(9, "Remove unlisted attendees\n");
                icalcomponent_free(vevent);
        }
 
-       /** If this was a save or deelete, go back to the calendar view. */
+       /** If this was a save or delete, go back to the calendar view. */
        if (strlen(bstr("check_button")) == 0) {
                readloop("readfwd");
        }
index cfce5f9743c401005144e8bd4dc941cae399fe0f..76a9757eaa002c6db450852517a89c7d51e10bb7 100644 (file)
@@ -2768,6 +2768,18 @@ void display_enter(void)
                is_anonymous = 1;
        }
 
+       /** First test to see whether this is a room that requires recipients to be entered */
+       serv_puts("ENT0 0");
+       serv_getln(buf, sizeof buf);
+       if (!strncmp(buf, "570", 3)) {          /** 570 means that we need a recipient here */
+               recipient_required = 1;
+       }
+       else if (buf[0] != '2') {               /** Any other error means that we cannot continue */
+               sprintf(WC->ImportantMessage, "%s", &buf[4]);
+               readloop("readnew");
+               return;
+       }
+
        /**
         * Are we perhaps in an address book view?  If so, then an "enter
         * message" command really means "add new entry."
@@ -2809,17 +2821,6 @@ void display_enter(void)
                "<div class=\"fix_scrollbar_bug\">"
                "<table width=100%% border=0 bgcolor=\"#ffffff\"><tr><td>");
 
-       /** First test to see whether this is a room that requires recipients to be entered */
-       serv_puts("ENT0 0");
-       serv_getln(buf, sizeof buf);
-       if (!strncmp(buf, "570", 3)) {          /** 570 means that we need a recipient here */
-               recipient_required = 1;
-       }
-       else if (buf[0] != '2') {               /** Any other error means that we cannot continue */
-               wprintf("<em>%s</em><br />\n", &buf[4]);
-               goto DONE;
-       }
-
        /** Now check our actual recipients if there are any */
        if (recipient_required) {
                sprintf(buf, "ENT0 0|%s|%d|0||||%s|%s|%s", bstr("recp"), is_anonymous,