diff options
| -rw-r--r-- | html.c | 25 |
1 files changed, 7 insertions, 18 deletions
| @@ -2188,11 +2188,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2188 | 2188 | ||
| 2189 | v = xs_dict_get(msg, "summary"); | 2189 | v = xs_dict_get(msg, "summary"); |
| 2190 | 2190 | ||
| 2191 | /* is it sensitive? */ | 2191 | if (!xs_is_null(v) && *v) { |
| 2192 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2193 | if (xs_is_null(v) || *v == '\0') | ||
| 2194 | v = "..."; | ||
| 2195 | |||
| 2196 | const char *cw = ""; | 2192 | const char *cw = ""; |
| 2197 | 2193 | ||
| 2198 | if (user) { | 2194 | if (user) { |
| @@ -2202,23 +2198,16 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2202 | cw = ""; | 2198 | cw = ""; |
| 2203 | } | 2199 | } |
| 2204 | 2200 | ||
| 2201 | xs_html *summary_tag = xs_html_tag("summary", xs_html_text(v)); | ||
| 2202 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2203 | xs_html_add(summary_tag, xs_html_text(L(" [SENSITIVE CONTENT]"))); | ||
| 2204 | } | ||
| 2205 | |||
| 2205 | snac_content = xs_html_tag("details", | 2206 | snac_content = xs_html_tag("details", |
| 2206 | xs_html_attr(cw, NULL), | 2207 | xs_html_attr(cw, NULL), |
| 2207 | xs_html_tag("summary", | 2208 | summary_tag); |
| 2208 | xs_html_text(v), | ||
| 2209 | xs_html_text(L(" [SENSITIVE CONTENT]")))); | ||
| 2210 | } | 2209 | } |
| 2211 | else { | 2210 | else { |
| 2212 | /* print the summary as a header (sites like e.g. Friendica can contain one) */ | ||
| 2213 | if (!has_title && !xs_is_null(v) && *v) { | ||
| 2214 | xs_html_add(snac_content_wrap, | ||
| 2215 | xs_html_tag("h3", | ||
| 2216 | xs_html_attr("class", "snac-entry-title"), | ||
| 2217 | xs_html_text(v))); | ||
| 2218 | |||
| 2219 | has_title = 1; | ||
| 2220 | } | ||
| 2221 | |||
| 2222 | snac_content = xs_html_tag("div", NULL); | 2211 | snac_content = xs_html_tag("div", NULL); |
| 2223 | } | 2212 | } |
| 2224 | 2213 | ||