HashList *MsgHeaderHandler = NULL;
HashList *MsgEvaluators = NULL;
HashList *MimeRenderHandler = NULL;
-int analyze_msg = 0;
+int dbg_analyze_msg = 0;
#define SUBJ_COL_WIDTH_PCT 50 /**< Mailbox view column width */
#define SENDER_COL_WIDTH_PCT 30 /**< Mailbox view column width */
StrBufCutLeft(Buf, StrLength(HdrToken) + 1);
#ifdef TECH_PREVIEW
- if (analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
+ if (dbg_analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
#endif
/* look up one of the examine_* functions to parse the content */
if (GetHash(MsgHeaderHandler, SKEY(HdrToken), &vHdr) &&
if (StrLength(HdrToken) > 0) {
StrBufCutLeft(Buf, StrLength(HdrToken) + 1);
#ifdef TECH_PREVIEW
- if (analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
+ if (dbg_analyze_msg) lprintf(1, ":: [%s] = [%s]\n", ChrPtr(HdrToken), ChrPtr(Buf));
#endif
/* the examine*'s know how to do with mime headers too... */
if (GetHash(MsgHeaderHandler, SKEY(HdrToken), &vHdr) &&
}
DeleteHashPos(&it);
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.ContextType = CTX_MAILSUM;
+ SubTP.Filter.ContextType = CTX_MAILSUM;
SubTP.Context = Msg;
DoTemplate(tmpl, tmpllen, Target, &SubTP);
WCTemplputParams SubTP;
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.ContextType = CTX_LONGVECTOR;
+ SubTP.Filter.ContextType = CTX_LONGVECTOR;
SubTP.Context = &vector;
TmpBuf = NewStrBuf();
At = GetNewHashPos(WCC->summ, nMessages);
if (havebstr("is_summary") && (1 == (ibstr("is_summary"))))
WCC->wc_view = VIEW_MAILBOX;
+ if (!WCC->is_ajax) {
+ output_headers(1, 1, 1, 0, 0, 0);
+ } else if (WCC->wc_view == VIEW_MAILBOX) {
+ jsonMessageListHdr();
+ }
+
switch (WCC->wc_view) {
case VIEW_WIKI:
sprintf(buf, "wiki?room=%s&page=home", ChrPtr(WCC->wc_roomname));
}
}
- if (!WCC->is_ajax) {
- output_headers(1, 1, 1, 0, 0, 0);
- } else if (WCC->wc_view == VIEW_MAILBOX) {
- jsonMessageListHdr();
- }
+
nummsgs = load_msg_ptrs(cmd, with_headers);
if (nummsgs == 0) {
if (care_for_empty_list) {
- wprintf("<div align=\"center\"><br /><em>");
+ wprintf("<div class=\"nomsgs\"><br><em>");
switch (oper) {
case readnew:
wprintf(_("No new messages."));
default:
wprintf(_("No messages here."));
}
- wprintf("</em><br /></div>\n");
+ wprintf("</em><br></div>\n");
goto DONE;
}
if (sortit) {
CompareFunc SortIt;
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.ContextType = CTX_NONE;
+ SubTP.Filter.ContextType = CTX_NONE;
SubTP.Context = NULL;
SortIt = RetrieveSort(&SubTP, NULL, 0,
HKEY("date"), defaultsortorder);
}
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.ContextType = CTX_STRBUF;
+ SubTP.Filter.ContextType = CTX_STRBUF;
SubTP.Context = MessageDropdown;
DoTemplate(HKEY("msg_listselector_top"), BBViewToolBar, &SubTP);
StrBufAppendBuf(WCC->WBuf, BBViewToolBar, 0);
displayed_msgs = NULL;
}
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.ContextType = CTX_STRBUF;
+ SubTP.Filter.ContextType = CTX_STRBUF;
SubTP.Context = MessageDropdown;
DoTemplate(HKEY("msg_listselector_bottom"), BBViewToolBar, &SubTP);
StrBufAppendBuf(WCC->WBuf, BBViewToolBar, 0);
/** Note: wDumpContent() will output one additional </div> tag. */
if (WCC->wc_view != VIEW_MAILBOX) {
/* We ought to move this out into template */
- wprintf("</div>\n"); /** end of 'content' div */
wDumpContent(1);
} else {
end_burst();
}
/* Spit out the new summary view. This is basically a static page, so clients can cache the layout, all the dirty work is javascript :) */
void new_summary_view(void) {
- output_headers(1,1,1,0,0,1);
begin_burst();
DoTemplate(HKEY("msg_listview"),NULL,&NoCtx);
DoTemplate(HKEY("trailing"),NULL,&NoCtx);
void jsonMessageList(void) {
const StrBuf *room = sbstr("room");
WC->is_ajax = 1;
- smart_goto(room);
+ long oper = (havebstr("query")) ? do_search : readnew;
+ gotoroom(room);
+ readloop(oper);
WC->is_ajax = 0;
}