summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-10-08 19:27:07 +0200
committerGravatar default2023-10-08 19:27:07 +0200
commit4676f8ce1383090da49f574282b7f7511ce15dd9 (patch)
treea079ab1bc37bc2480328bb638c8c09badbead05b
parentHide posts from the public web for accounts with 'private' == true. (diff)
downloadsnac2-4676f8ce1383090da49f574282b7f7511ce15dd9.tar.gz
snac2-4676f8ce1383090da49f574282b7f7511ce15dd9.tar.xz
snac2-4676f8ce1383090da49f574282b7f7511ce15dd9.zip
The HTML user page does not show an error, only the empty header.
-rw-r--r--html.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/html.c b/html.c
index c5e76fc..1fd0083 100644
--- a/html.c
+++ b/html.c
@@ -1591,7 +1591,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local, int skip, int
1591 1591
1592 s = xs_str_cat(s, "</div>\n"); 1592 s = xs_str_cat(s, "</div>\n");
1593 1593
1594 if (user && local) { 1594 if (list && user && local) {
1595 xs *s1 = xs_fmt( 1595 xs *s1 = xs_fmt(
1596 "<div class=\"snac-history\">\n" 1596 "<div class=\"snac-history\">\n"
1597 "<p class=\"snac-history-title\">%s</p><ul>\n", 1597 "<p class=\"snac-history-title\">%s</p><ul>\n",
@@ -1959,11 +1959,14 @@ int html_get_handler(const xs_dict *req, const char *q_path,
1959 show = atoi(v), cache = 0, save = 0; 1959 show = atoi(v), cache = 0, save = 0;
1960 1960
1961 if (p_path == NULL) { /** public timeline **/ 1961 if (p_path == NULL) { /** public timeline **/
1962 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE)
1963 return 403;
1964
1965 xs *h = xs_str_localtime(0, "%Y-%m.html"); 1962 xs *h = xs_str_localtime(0, "%Y-%m.html");
1966 1963
1964 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) {
1965 *body = html_timeline(&snac, NULL, 1, 0, 0, 0);
1966 *b_size = strlen(*body);
1967 status = 200;
1968 }
1969 else
1967 if (cache && history_mtime(&snac, h) > timeline_mtime(&snac)) { 1970 if (cache && history_mtime(&snac, h) > timeline_mtime(&snac)) {
1968 snac_debug(&snac, 1, xs_fmt("serving cached local timeline")); 1971 snac_debug(&snac, 1, xs_fmt("serving cached local timeline"));
1969 1972