]> 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 b123b8c5a51ebc8de229ec891226e627a5662268..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;