X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmessages.c;h=2915ce1480d5b623c2320395ee8e7cad63830c56;hb=7ba7f73f95cad7f4ecd7f986e12095e9bb546126;hp=cb9001d050c7e4af5a038d22b8c864acbd8c3afb;hpb=77ac237c6ef5e2d0b2aa800ebb45ed7265f1bb28;p=citadel.git diff --git a/webcit/messages.c b/webcit/messages.c index cb9001d05..2915ce148 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -20,7 +20,7 @@ #include "webcit.h" #include "webserver.h" -#include "groupdav.h" +#include "dav.h" #include "calendar.h" HashList *MsgHeaderHandler = NULL; @@ -1010,7 +1010,7 @@ void post_message(void) int saving_to_drafts = 0; long HeaderLen = 0; - saving_to_drafts = !strcasecmp(bstr("submit_action"), "drafts"); + saving_to_drafts = !strcasecmp(bstr("submit_action"), "draft"); Buf = NewStrBuf(); if (saving_to_drafts) { @@ -1113,7 +1113,7 @@ void post_message(void) if (saving_to_drafts) { AppendImportantMessage(_("Message has been saved to Drafts.\n"), -1); gotoroom(WCC->CurRoom.name); - display_enter(); + readloop(readnew, eUseDefault); FreeStrBuf(&Buf); return; } else if ( (havebstr("recp")) @@ -1721,6 +1721,7 @@ void postpart(StrBuf *partnum, StrBuf *filename, int force_download) void mimepart(int force_download) { long msgnum; + long ErrorDetail; StrBuf *att; wcsession *WCC = WC; StrBuf *Buf; @@ -1734,7 +1735,7 @@ void mimepart(int force_download) serv_printf("OPNA %ld|%s", msgnum, ChrPtr(att)); StrBuf_ServGetln(Buf); - if (GetServerStatus(Buf, NULL) == 2) { + if (GetServerStatus(Buf, &ErrorDetail) == 2) { StrBufCutLeft(Buf, 4); bytes = StrBufExtract_long(Buf, 0, '|'); if (!force_download) { @@ -1758,7 +1759,23 @@ void mimepart(int force_download) http_transmit_thing(CT, 0); } else { StrBufCutLeft(Buf, 4); - hprintf("HTTP/1.1 404 %s\n", ChrPtr(Buf)); + switch (ErrorDetail) { + default: + case ERROR + MESSAGE_NOT_FOUND: + hprintf("HTTP/1.1 404 %s\n", ChrPtr(Buf)); + break; + case ERROR + NOT_LOGGED_IN: + hprintf("HTTP/1.1 401 %s\n", ChrPtr(Buf)); + break; + + case ERROR + HIGHER_ACCESS_REQUIRED: + hprintf("HTTP/1.1 403 %s\n", ChrPtr(Buf)); + break; + case ERROR + INTERNAL_ERROR: + case ERROR + TOO_BIG: + hprintf("HTTP/1.1 500 %s\n", ChrPtr(Buf)); + break; + } output_headers(0, 0, 0, 0, 0, 0); hprintf("Content-Type: text/plain\r\n"); begin_burst();