/* begin everythingamundo table */
HdrToken = NewStrBuf();
- while ((StrBuf_ServGetln(Buf)>=0) && !Done) {
+ while (!Done && StrBuf_ServGetln(Buf)>=0) {
if ( (StrLength(Buf)==3) &&
!strcmp(ChrPtr(Buf), "000"))
{
FreeStrBuf(&Error);
}
- /* strip the bare contenttype, so we ommit charset etc. */
+ /* Extract just the content-type (omit attributes such as "charset") */
StrBufExtract_token(Buf, Msg->MsgBody->ContentType, 0, ';');
StrBufTrim(Buf);
StrBufLowerCase(Buf);
- /* look up the renderer, that will convert this mimeitem into the htmlized form */
+
+ /* Locate a renderer capable of converting this MIME part into HTML */
if (GetHash(MimeRenderHandler, SKEY(Buf), &vHdr) &&
(vHdr != NULL)) {
RenderMimeFuncStruct *Render;
/*
* command loop for reading messages
*
- * Set oper to "readnew" or "readold" or "readfwd" or "headers" or "readgt"
+ * Set oper to "readnew" or "readold" or "readfwd" or "headers" or "readgt" or "readlt" or "do_search"
*/
void readloop(long oper)
{
SharedMessageStatus Stat;
void *ViewSpecific;
- if (havebstr("is_summary") && (1 == (ibstr("is_summary"))))
+ if (havebstr("is_summary") && (1 == (ibstr("is_summary")))) {
WCC->wc_view = VIEW_MAILBOX;
+ }
+
+ if (havebstr("is_ajax") && (1 == (ibstr("is_ajax")))) {
+ WCC->is_ajax = 1;
+ }
+
+ if ((oper == do_search) && (WCC->wc_view == VIEW_WIKI)) {
+ display_wiki_pagelist();
+ return;
+ }
memset(&Stat, 0, sizeof(SharedMessageStatus));
Stat.maxload = 10000;
WCC->wc_view = VIEW_BBS;
GetHash(ReadLoopHandler, IKEY(WCC->wc_view), &vViewMsg);
}
- if (vViewMsg == NULL)
- return;///TODO: print message
+ if (vViewMsg == NULL) {
+ return; // TODO: print message
+ }
ViewMsg = (RoomRenderer*) vViewMsg;
if (!WCC->is_ajax) {
if (Stat.sortit) {
CompareFunc SortIt;
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.Filter.ContextType = CTX_NONE;
+ SubTP.Filter.ContextType = CTX_MAILSUM;
SubTP.Context = NULL;
SortIt = RetrieveSort(&SubTP, NULL, 0,
HKEY("date"), Stat.defaultsortorder);
Recp = sbstr("recp");
Cc = sbstr("cc");
Bcc = sbstr("bcc");
- Wikipage = sbstr("wikipage");
+ Wikipage = sbstr("page");
my_email_addr = sbstr("my_email_addr");
CmdBuf = NewStrBufPlain(NULL,
/*
* If we were editing a page in a wiki room, go to that page now.
*/
- else if (havebstr("wikipage")) {
- snprintf(buf, sizeof buf, "wiki?page=%s", bstr("wikipage"));
+ else if (havebstr("page")) {
+ snprintf(buf, sizeof buf, "wiki?page=%s", bstr("page"));
http_redirect(buf);
}
/*
Recp = sbstr("recp");
Cc = sbstr("cc");
Bcc = sbstr("bcc");
- Wikipage = sbstr("wikipage");
+ Wikipage = sbstr("page");
CmdBuf = NewStrBufPlain(NULL,
sizeof (CMD) +
void h_headers(void) { readloop(headers);}
void h_do_search(void) { readloop(do_search);}
void h_readgt(void) { readloop(readgt);}
+void h_readlt(void) { readloop(readlt);}
void jsonMessageListHdr(void)
{
WebcitAddUrlHandler(HKEY("readfwd"), "", 0, h_readfwd, NEED_URL);
WebcitAddUrlHandler(HKEY("headers"), "", 0, h_headers, NEED_URL);
WebcitAddUrlHandler(HKEY("readgt"), "", 0, h_readgt, NEED_URL);
+ WebcitAddUrlHandler(HKEY("readlt"), "", 0, h_readlt, NEED_URL);
WebcitAddUrlHandler(HKEY("do_search"), "", 0, h_do_search, 0);
WebcitAddUrlHandler(HKEY("display_enter"), "", 0, display_enter, 0);
WebcitAddUrlHandler(HKEY("post"), "", 0, post_message, 0);