diff options
| author | 2023-10-08 19:27:07 +0200 | |
|---|---|---|
| committer | 2023-10-08 19:27:07 +0200 | |
| commit | 4676f8ce1383090da49f574282b7f7511ce15dd9 (patch) | |
| tree | a079ab1bc37bc2480328bb638c8c09badbead05b | |
| parent | Hide posts from the public web for accounts with 'private' == true. (diff) | |
| download | snac2-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.c | 11 |
1 files changed, 7 insertions, 4 deletions
| @@ -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 | ||