]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* fix search in mailbox view
[citadel.git] / webcit / messages.c
index 2422629450667ac32b4b4c1e65d124d8f4f1b296..9153eaa8d51493b92c9b87cecc1c5e2dbbd67643 100644 (file)
@@ -12,7 +12,7 @@
 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 */
@@ -109,7 +109,7 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, in
                        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) &&
@@ -136,7 +136,7 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, in
                                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) &&
@@ -235,7 +235,7 @@ int read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, in
        }
        DeleteHashPos(&it);
        memset(&SubTP, 0, sizeof(WCTemplputParams));
-       SubTP.ContextType = CTX_MAILSUM;
+       SubTP.Filter.ContextType = CTX_MAILSUM;
        SubTP.Context = Msg;
        DoTemplate(tmpl, tmpllen, Target, &SubTP);
 
@@ -511,7 +511,7 @@ long DrawMessageDropdown(StrBuf *Selector, long maxmsgs, long startmsg, int nMes
        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);
@@ -761,7 +761,7 @@ void readloop(long oper)
        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);
@@ -800,7 +800,7 @@ void readloop(long oper)
 
                }
                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);
@@ -890,7 +890,7 @@ void readloop(long oper)
                        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);
@@ -1655,7 +1655,9 @@ void new_summary_view(void) {
 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;
 }