mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Fixed history disabling.
This commit is contained in:
parent
4afb384024
commit
b8e5a00eab
41
html.c
41
html.c
@ -1600,29 +1600,34 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local,
|
|||||||
|
|
||||||
s = xs_str_cat(s, "</div>\n");
|
s = xs_str_cat(s, "</div>\n");
|
||||||
|
|
||||||
if (list && user && local && xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) {
|
if (list && user && local) {
|
||||||
xs *s1 = xs_fmt(
|
if (xs_type(xs_dict_get(srv_config, "disable_history")) == XSTYPE_TRUE) {
|
||||||
"<div class=\"snac-history\">\n"
|
s = xs_str_cat(s, "<!-- history disabled -->\n");
|
||||||
"<p class=\"snac-history-title\">%s</p><ul>\n",
|
}
|
||||||
L("History")
|
else {
|
||||||
);
|
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
|
||||||
|
|
||||||
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(
|
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);
|
||||||
|
|
||||||
|
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(
|
||||||
"<li><a href=\"%s/h/%s\">%s</a></li>\n",
|
"<li><a href=\"%s/h/%s\">%s</a></li>\n",
|
||||||
user->actor, v, fn);
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user