]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* When entering a wiki room, display the wiki home page using the view render API...
[citadel.git] / webcit / messages.c
index 3c543934546edd44b71707e8251c07aca667c816..8ca8a3126eb795451df86fec3f1e929c2e075dbc 100644 (file)
@@ -759,7 +759,7 @@ void readloop(long oper)
        void *vMsg;
        message_summary *Msg;
        char cmd[256] = "";
-       int i;
+       int i, r;
        wcsession *WCC = WC;
        HashPos *at;
        const char *HashKey;
@@ -790,11 +790,17 @@ void readloop(long oper)
                jsonMessageListHdr();
        }
 
-       switch(ViewMsg->GetParamsGetServerCall(
+       if (ViewMsg->GetParamsGetServerCall != NULL) {
+               r = ViewMsg->GetParamsGetServerCall(
                       &Stat,
                       &ViewSpecific,
                       oper,
-                      cmd, sizeof(cmd)))
+                      cmd, sizeof(cmd)
+               );
+       } else {
+               r = 0;
+       }
+       switch(r)
        {
        case 400:
        case 404:
@@ -952,6 +958,8 @@ void post_mime_to_server(void) {
                it = GetNewHashPos(WCC->attachments, 0);
                while (GetNextHashPos(WCC->attachments, it, &len, &Key, &vAtt)) {
                        att = (wc_mime_attachment *)vAtt;
+                       if (att->length == 0)
+                               continue;
                        encoded_length = ((att->length * 150) / 100);
                        encoded = malloc(encoded_length);
                        if (encoded == NULL) break;
@@ -1480,6 +1488,7 @@ void postpart(StrBuf *partnum, StrBuf *filename, int force_download)
                hprintf("HTTP/1.1 404 %s\n", ChrPtr(partnum));
                output_headers(0, 0, 0, 0, 0, 0);
                hprintf("Content-Type: text/plain\r\n");
+               begin_burst();
                wprintf(_("An error occurred while retrieving this part: %s/%s\n"), 
                        ChrPtr(partnum), ChrPtr(filename));
                end_burst();
@@ -1539,6 +1548,7 @@ void mimepart(int force_download)
                hprintf("HTTP/1.1 404 %s\n", ChrPtr(Buf));
                output_headers(0, 0, 0, 0, 0, 0);
                hprintf("Content-Type: text/plain\r\n");
+               begin_burst();
                wprintf(_("An error occurred while retrieving this part: %s\n"), 
                        ChrPtr(Buf));
                end_burst();
@@ -1685,7 +1695,6 @@ void RegisterReadLoopHandlerset(
        Handler->ViewCleanup = ViewCleanup;
 
        Put(ReadLoopHandler, IKEY(RoomType), Handler, NULL);
-
 }
 
 void