snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 1762e0f1459599524b54aabfd470e171e1d6e592
parent f2a33727e781a9f7338d8321b3d5b504ca4dab8e
Author: default <nobody@localhost>
Date:   Sat, 11 May 2024 09:29:38 +0200

Added an incremental max seconds value to every content search page.

Diffstat:
Mhtml.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/html.c b/html.c @@ -2525,7 +2525,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, int skip = 0; int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); - char *q_vars = xs_dict_get(req, "q_vars"); + xs_dict *q_vars = xs_dict_get(req, "q_vars"); if ((v = xs_dict_get(q_vars, "skip")) != NULL) skip = atoi(v), cache = 0, save = 0; if ((v = xs_dict_get(q_vars, "show")) != NULL) @@ -2575,9 +2575,10 @@ int html_get_handler(const xs_dict *req, const char *q_path, if (q && *q) { /** search by content **/ int to = 0; - xs *tl = content_search(&snac, q, 1, skip, show, skip ? 10 : 0, &to); + int msecs = atoi(xs_dict_get_def(q_vars, "msecs", "0")); + xs *tl = content_search(&snac, q, 1, skip, show, msecs, &to); xs *title = NULL; - xs *page = xs_fmt("/admin?q=%s", q); + xs *page = xs_fmt("/admin?q=%s&msecs=%d", q, msecs + 10); int tl_len = xs_list_len(tl); if (tl_len)