snac2

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

commit 3c6d32334ad03cecb9669cccd820ebc7f5b8877d
parent 562bea2cf938d092435d8685050644afba8ce5d9
Author: default <nobody@localhost>
Date:   Sun, 19 Nov 2023 18:34:14 +0100

History can be disabled.

Diffstat:
Mhtml.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/html.c b/html.c @@ -1600,7 +1600,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local, s = xs_str_cat(s, "</div>\n"); - if (list && user && local) { + if (list && user && local && xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) { xs *s1 = xs_fmt( "<div class=\"snac-history\">\n" "<p class=\"snac-history-title\">%s</p><ul>\n", @@ -2105,6 +2105,9 @@ int html_get_handler(const xs_dict *req, const char *q_path, if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) return 403; + if (xs_type(xs_dict_get(srv_config, "disable_history")) == XSTYPE_TRUE) + return 403; + xs *l = xs_split(p_path, "/"); char *id = xs_list_get(l, 1);