5 int json_GetParamsGetServerCall(SharedMessageStatus *Stat,
13 Stat->defaultsortorder = 2;
16 /* Generally using maxmsgs|startmsg is not required
17 in mailbox view, but we have a 'safemode' for clients
18 (*cough* Exploder) that simply can't handle too many */
19 if (havebstr("maxmsgs")) Stat->maxmsgs = ibstr("maxmsgs");
20 else Stat->maxmsgs = 9999999;
21 if (havebstr("startmsg")) Stat->startmsg = lbstr("startmsg");
22 snprintf(cmd, len, "MSGS %s|%s||1",
23 (oper == do_search) ? "SEARCH" : "ALL",
24 (oper == do_search) ? bstr("query") : ""
29 int json_MessageListHdr(SharedMessageStatus *Stat, void **ViewSpecific)
31 /* TODO: make a generic function */
32 hprintf("HTTP/1.1 200 OK\r\n");
33 hprintf("Content-type: application/json; charset=utf-8\r\n");
34 hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(WC->serv_info->serv_software));
35 hprintf("Connection: close\r\n");
36 hprintf("Pragma: no-cache\r\nCache-Control: no-store\r\nExpires:-1\r\n");
41 int json_RenderView_or_Tail(SharedMessageStatus *Stat,
45 DoTemplate(HKEY("mailsummary_json"),NULL, NULL);
50 int json_Cleanup(void **ViewSpecific)
52 /* Note: wDumpContent() will output one additional </div> tag. */
53 /* We ought to move this out into template */
60 InitModule_JSONRENDERER
63 RegisterReadLoopHandlerset(
65 json_GetParamsGetServerCall,
67 NULL, /* TODO: is this right? */
68 ParseMessageListHeaders_Detail,
70 json_RenderView_or_Tail,