snac2

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

commit f4fee170ce4d02182081f084975c3cd7d9ba4e93
parent 22a23dbdd1fca4695c012c31d5e5502f38212ed8
Author: default <nobody@localhost>
Date:   Thu,  6 Feb 2025 19:16:49 +0100

If 'def_timeline_entries' is not set, 'max_timeline_entries' is used (instead of the default).

Diffstat:
Mhtml.c | 3++-
Mhttpd.c | 3++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/html.c b/html.c @@ -3327,7 +3327,8 @@ int html_get_handler(const xs_dict *req, const char *q_path, cache = 0; int skip = 0; - int def_show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", "50")); + int def_show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", + xs_dict_get_def(srv_config, "max_timeline_entries", "50"))); int show = def_show; if ((v = xs_dict_get(q_vars, "skip")) != NULL) diff --git a/httpd.c b/httpd.c @@ -219,7 +219,8 @@ int server_get_handler(xs_dict *req, const char *q_path, if (xs_type(q_vars) == XSTYPE_DICT && (t = xs_dict_get(q_vars, "t"))) { /** search by tag **/ int skip = 0; - int show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", "50")); + int show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", + xs_dict_get_def(srv_config, "max_timeline_entries", "50"))); const char *v; if ((v = xs_dict_get(q_vars, "skip")) != NULL)