diff options
author | default <nobody@localhost> | 2023-11-19 18:44:02 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-11-19 18:44:02 +0100 |
commit | b8e5a00eab2b227dcd6fd93eab5951e81368ceaa (patch) | |
tree | ab6ff78adc4da406f88449291d817c786b871239 /html.c | |
parent | 4afb384024e8711039e8827fc5b87a42af8aae7e (diff) |
Fixed history disabling.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -1600,29 +1600,34 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local, s = xs_str_cat(s, "</div>\n"); - 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", - L("History") - ); + if (list && user && local) { + if (xs_type(xs_dict_get(srv_config, "disable_history")) == XSTYPE_TRUE) { + s = xs_str_cat(s, "<!-- history disabled -->\n"); + } + else { + xs *s1 = xs_fmt( + "<div class=\"snac-history\">\n" + "<p class=\"snac-history-title\">%s</p><ul>\n", + L("History") + ); - s = xs_str_cat(s, s1); + s = xs_str_cat(s, s1); - xs *list = history_list(user); - char *p, *v; + xs *list = history_list(user); + char *p, *v; - p = list; - while (xs_list_iter(&p, &v)) { - xs *fn = xs_replace(v, ".html", ""); - xs *s1 = xs_fmt( + p = list; + while (xs_list_iter(&p, &v)) { + xs *fn = xs_replace(v, ".html", ""); + xs *s1 = xs_fmt( "<li><a href=\"%s/h/%s\">%s</a></li>\n", user->actor, v, fn); - s = xs_str_cat(s, s1); - } + s = xs_str_cat(s, s1); + } - s = xs_str_cat(s, "</ul></div>\n"); + s = xs_str_cat(s, "</ul></div>\n"); + } } { |