commit 3c6d323

default  ·  2023-11-19 17:34:14 +0000 UTC
parent 562bea2
History can be disabled.
1 files changed,  +4, -1
M html.c
M html.c
+4, -1
 1@@ -1600,7 +1600,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local,
 2 
 3     s = xs_str_cat(s, "</div>\n");
 4 
 5-    if (list && user && local) {
 6+    if (list && user && local && xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) {
 7         xs *s1 = xs_fmt(
 8             "<div class=\"snac-history\">\n"
 9             "<p class=\"snac-history-title\">%s</p><ul>\n",
10@@ -2105,6 +2105,9 @@ int html_get_handler(const xs_dict *req, const char *q_path,
11         if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE)
12             return 403;
13 
14+        if (xs_type(xs_dict_get(srv_config, "disable_history")) == XSTYPE_TRUE)
15+            return 403;
16+
17         xs *l    = xs_split(p_path, "/");
18         char *id = xs_list_get(l, 1);
19