From: Art Cancro Date: Fri, 26 May 2006 16:38:49 +0000 (+0000) Subject: Handle read-only rooms more gracefully when attempting X-Git-Tag: v7.86~4011 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=d4d647ab8385d2d87e7b4fb000b34a43712a6f6a;p=citadel.git Handle read-only rooms more gracefully when attempting to post calendar items, etc. --- diff --git a/webcit/event.c b/webcit/event.c index 3490b79fb..af670ff59 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -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"); } diff --git a/webcit/messages.c b/webcit/messages.c index cfce5f974..76a9757ea 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -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) "
" "
"); - /** 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("%s
\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,