diff options
| author | 2023-11-19 18:44:02 +0100 | |
|---|---|---|
| committer | 2023-11-19 18:44:02 +0100 | |
| commit | b8e5a00eab2b227dcd6fd93eab5951e81368ceaa (patch) | |
| tree | ab6ff78adc4da406f88449291d817c786b871239 | |
| parent | Updated documentation. (diff) | |
| download | snac2-b8e5a00eab2b227dcd6fd93eab5951e81368ceaa.tar.gz snac2-b8e5a00eab2b227dcd6fd93eab5951e81368ceaa.tar.xz snac2-b8e5a00eab2b227dcd6fd93eab5951e81368ceaa.zip | |
Fixed history disabling.
| -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, | |||
| 1600 | 1600 | ||
| 1601 | s = xs_str_cat(s, "</div>\n"); | 1601 | s = xs_str_cat(s, "</div>\n"); |
| 1602 | 1602 | ||
| 1603 | if (list && user && local && xs_type(xs_dict_get(srv_config, "disable_history")) != XSTYPE_TRUE) { | 1603 | if (list && user && local) { |
| 1604 | xs *s1 = xs_fmt( | 1604 | if (xs_type(xs_dict_get(srv_config, "disable_history")) == XSTYPE_TRUE) { |
| 1605 | "<div class=\"snac-history\">\n" | 1605 | s = xs_str_cat(s, "<!-- history disabled -->\n"); |
| 1606 | "<p class=\"snac-history-title\">%s</p><ul>\n", | 1606 | } |
| 1607 | L("History") | 1607 | else { |
| 1608 | ); | 1608 | xs *s1 = xs_fmt( |
| 1609 | "<div class=\"snac-history\">\n" | ||
| 1610 | "<p class=\"snac-history-title\">%s</p><ul>\n", | ||
| 1611 | L("History") | ||
| 1612 | ); | ||
| 1609 | 1613 | ||
| 1610 | s = xs_str_cat(s, s1); | 1614 | s = xs_str_cat(s, s1); |
| 1611 | 1615 | ||
| 1612 | xs *list = history_list(user); | 1616 | xs *list = history_list(user); |
| 1613 | char *p, *v; | 1617 | char *p, *v; |
| 1614 | 1618 | ||
| 1615 | p = list; | 1619 | p = list; |
| 1616 | while (xs_list_iter(&p, &v)) { | 1620 | while (xs_list_iter(&p, &v)) { |
| 1617 | xs *fn = xs_replace(v, ".html", ""); | 1621 | xs *fn = xs_replace(v, ".html", ""); |
| 1618 | xs *s1 = xs_fmt( | 1622 | xs *s1 = xs_fmt( |
| 1619 | "<li><a href=\"%s/h/%s\">%s</a></li>\n", | 1623 | "<li><a href=\"%s/h/%s\">%s</a></li>\n", |
| 1620 | user->actor, v, fn); | 1624 | user->actor, v, fn); |
| 1621 | 1625 | ||
| 1622 | s = xs_str_cat(s, s1); | 1626 | s = xs_str_cat(s, s1); |
| 1623 | } | 1627 | } |
| 1624 | 1628 | ||
| 1625 | s = xs_str_cat(s, "</ul></div>\n"); | 1629 | s = xs_str_cat(s, "</ul></div>\n"); |
| 1630 | } | ||
| 1626 | } | 1631 | } |
| 1627 | 1632 | ||
| 1628 | { | 1633 | { |