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
11
data.c
11
data.c
|
@ -2499,8 +2499,10 @@ xs_list *content_search(snac *user, const char *regex,
|
||||||
return xs_list_new();
|
return xs_list_new();
|
||||||
|
|
||||||
xs_set seen;
|
xs_set seen;
|
||||||
|
xs_set skipped;
|
||||||
|
|
||||||
xs_set_init(&seen);
|
xs_set_init(&seen);
|
||||||
|
xs_set_init(&skipped);
|
||||||
|
|
||||||
if (max_secs == 0)
|
if (max_secs == 0)
|
||||||
max_secs = 3;
|
max_secs = 3;
|
||||||
|
@ -2592,13 +2594,18 @@ xs_list *content_search(snac *user, const char *regex,
|
||||||
xs *l = xs_regex_select_n(c, regex, 1);
|
xs *l = xs_regex_select_n(c, regex, 1);
|
||||||
|
|
||||||
if (xs_list_len(l)) {
|
if (xs_list_len(l)) {
|
||||||
if (skip > 0)
|
if (skip > 0) {
|
||||||
|
if (xs_set_add(&skipped, md5) == 1)
|
||||||
skip--;
|
skip--;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
if (xs_set_add(&seen, md5) == 1)
|
if (xs_set_add(&seen, md5) == 1)
|
||||||
show--;
|
show--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
xs_set_free(&skipped);
|
||||||
|
|
||||||
return xs_set_result(&seen);
|
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
|
else
|
||||||
title = xs_fmt(L("Nothing found for '%s'"), q);
|
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);
|
*b_size = strlen(*body);
|
||||||
status = 200;
|
status = 200;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue