mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
More web ui search tweaks baaaaah I'm boring.
This commit is contained in:
parent
1632e009a4
commit
5d1577af3c
2 changed files with 13 additions and 6 deletions
17
data.c
17
data.c
|
@ -2499,8 +2499,10 @@ xs_list *content_search(snac *user, const char *regex,
|
|||
return xs_list_new();
|
||||
|
||||
xs_set seen;
|
||||
xs_set skipped;
|
||||
|
||||
xs_set_init(&seen);
|
||||
xs_set_init(&skipped);
|
||||
|
||||
if (max_secs == 0)
|
||||
max_secs = 3;
|
||||
|
@ -2592,14 +2594,19 @@ xs_list *content_search(snac *user, const char *regex,
|
|||
xs *l = xs_regex_select_n(c, regex, 1);
|
||||
|
||||
if (xs_list_len(l)) {
|
||||
if (skip > 0)
|
||||
skip--;
|
||||
else
|
||||
if (xs_set_add(&seen, md5) == 1)
|
||||
show--;
|
||||
if (skip > 0) {
|
||||
if (xs_set_add(&skipped, md5) == 1)
|
||||
skip--;
|
||||
}
|
||||
else {
|
||||
if (xs_set_add(&seen, md5) == 1)
|
||||
show--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xs_set_free(&skipped);
|
||||
|
||||
return xs_set_result(&seen);
|
||||
}
|
||||
|
||||
|
|
2
html.c
2
html.c
|
@ -2578,7 +2578,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
|
|||
else
|
||||
title = xs_fmt(L("Nothing found for '%s'"), q);
|
||||
|
||||
*body = html_timeline(&snac, tl, 0, skip, show, tl_len > 0, title, page, 1);
|
||||
*body = html_timeline(&snac, tl, 0, skip, tl_len, tl_len > 0, title, page, 1);
|
||||
*b_size = strlen(*body);
|
||||
status = 200;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue