diff options
| -rw-r--r-- | html.c | 25 |
1 files changed, 7 insertions, 18 deletions
| @@ -2242,11 +2242,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2242 | 2242 | ||
| 2243 | v = xs_dict_get(msg, "summary"); | 2243 | v = xs_dict_get(msg, "summary"); |
| 2244 | 2244 | ||
| 2245 | /* is it sensitive? */ | 2245 | if (!xs_is_null(v) && *v) { |
| 2246 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2247 | if (xs_is_null(v) || *v == '\0') | ||
| 2248 | v = "..."; | ||
| 2249 | |||
| 2250 | const char *cw = ""; | 2246 | const char *cw = ""; |
| 2251 | 2247 | ||
| 2252 | if (user) { | 2248 | if (user) { |
| @@ -2256,23 +2252,16 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2256 | cw = ""; | 2252 | cw = ""; |
| 2257 | } | 2253 | } |
| 2258 | 2254 | ||
| 2255 | xs_html *summary_tag = xs_html_tag("summary", xs_html_text(v)); | ||
| 2256 | if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { | ||
| 2257 | xs_html_add(summary_tag, xs_html_text(L(" [SENSITIVE CONTENT]"))); | ||
| 2258 | } | ||
| 2259 | |||
| 2259 | snac_content = xs_html_tag("details", | 2260 | snac_content = xs_html_tag("details", |
| 2260 | xs_html_attr(cw, NULL), | 2261 | xs_html_attr(cw, NULL), |
| 2261 | xs_html_tag("summary", | 2262 | summary_tag); |
| 2262 | xs_html_text(v), | ||
| 2263 | xs_html_text(L(" [SENSITIVE CONTENT]")))); | ||
| 2264 | } | 2263 | } |
| 2265 | else { | 2264 | else { |
| 2266 | /* print the summary as a header (sites like e.g. Friendica can contain one) */ | ||
| 2267 | if (!has_title && !xs_is_null(v) && *v) { | ||
| 2268 | xs_html_add(snac_content_wrap, | ||
| 2269 | xs_html_tag("h3", | ||
| 2270 | xs_html_attr("class", "snac-entry-title"), | ||
| 2271 | xs_html_text(v))); | ||
| 2272 | |||
| 2273 | has_title = 1; | ||
| 2274 | } | ||
| 2275 | |||
| 2276 | snac_content = xs_html_tag("div", NULL); | 2265 | snac_content = xs_html_tag("div", NULL); |
| 2277 | } | 2266 | } |
| 2278 | 2267 | ||