* The 'Search' box now works properly in a Wiki room.
authorArt Cancro <ajc@citadel.org>
Wed, 11 Nov 2009 16:27:04 +0000 (16:27 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 11 Nov 2009 16:27:04 +0000 (16:27 +0000)
webcit/messages.c
webcit/webcit.h
webcit/wiki.c

index 682477de34064596615cc229f54e388190425cc2..53b5b9eb6b15c57d70f540767da4f8066b85cd84 100644 (file)
@@ -751,7 +751,7 @@ typedef struct _RoomRenderer{
 /*
  * 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 "do_search"
  */
 void readloop(long oper)
 {
@@ -769,8 +769,14 @@ 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 (WCC->wc_view == VIEW_WIKI) {
+               display_wiki_pagelist();
+               return;
+       }
 
        memset(&Stat, 0, sizeof(SharedMessageStatus));
        Stat.maxload = 10000;
@@ -781,8 +787,9 @@ void readloop(long oper)
                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) {
index 3dc49116f4a6856c8d5b0dd120b3afce1330392d..e015ce50fb4b9b18d3e5c77a2503e8efbf741a8e 100644 (file)
@@ -793,6 +793,7 @@ long guess_calhourformat(void);
 int get_time_format_cached (void);
 int xtoi(const char *in, size_t len);
 const char *get_selected_language(void);
+void display_wiki_pagelist(void);
 
 #define DATEFMT_FULL 0
 #define DATEFMT_BRIEF 1
index b7b03c1a0363e9885443263456f9d0b89a0be7b2..71f052efee3d64e29b97045752563a11ca8f5379 100644 (file)
@@ -272,7 +272,13 @@ void tmplput_display_wiki_pagelist(StrBuf *Target, WCTemplputParams *TP)
                }
        }
 
-       serv_printf("MSGS ALL|||4");
+       if (!IsEmptyStr(bstr("query"))) {
+               serv_printf("MSGS SEARCH|%s||4", bstr("query"));        /* search-reduced list */
+       }
+       else {
+               serv_printf("MSGS ALL|||4");                            /* full list */
+       }
+
        Buf = NewStrBuf();
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 1) {
@@ -305,7 +311,7 @@ void tmplput_display_wiki_pagelist(StrBuf *Target, WCTemplputParams *TP)
 
 
 /*
- * Display a list of all pages in a Wiki room
+ * Display a list of all pages in a Wiki room.  Search requests in a Wiki room also go here.
  */
 void display_wiki_pagelist(void)
 {