commit 1762e0f

default  ·  2024-05-11 07:29:38 +0000 UTC
parent f2a3372
Added an incremental max seconds value to every content search page.
1 files changed,  +4, -3
M html.c
M html.c
+4, -3
 1@@ -2525,7 +2525,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
 2 
 3     int skip = 0;
 4     int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries"));
 5-    char *q_vars = xs_dict_get(req, "q_vars");
 6+    xs_dict *q_vars = xs_dict_get(req, "q_vars");
 7     if ((v = xs_dict_get(q_vars, "skip")) != NULL)
 8         skip = atoi(v), cache = 0, save = 0;
 9     if ((v = xs_dict_get(q_vars, "show")) != NULL)
10@@ -2575,9 +2575,10 @@ int html_get_handler(const xs_dict *req, const char *q_path,
11             if (q && *q) {
12                 /** search by content **/
13                 int to = 0;
14-                xs *tl = content_search(&snac, q, 1, skip, show, skip ? 10 : 0, &to);
15+                int msecs = atoi(xs_dict_get_def(q_vars, "msecs", "0"));
16+                xs *tl = content_search(&snac, q, 1, skip, show, msecs, &to);
17                 xs *title = NULL;
18-                xs *page = xs_fmt("/admin?q=%s", q);
19+                xs *page = xs_fmt("/admin?q=%s&msecs=%d", q, msecs + 10);
20                 int tl_len = xs_list_len(tl);
21 
22                 if (tl_len)