diff options
| author | grunfink <grunfink@comam.es> | 2025-09-30 09:51:04 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2025-09-30 09:51:04 +0200 |
| commit | 1e62e504e1d31e9d7c9e5fa7cd83e5654900941a (patch) | |
| tree | dce4acd54001ebff38186845a4591956fa9e23d9 | |
| parent | 5c958b5b188b9f3559f734d22eb9819b3e44a403 (diff) | |
| parent | 02e028b1d634fe21b2d2697d6b072ca71a6a4ce0 (diff) | |
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
| -rw-r--r-- | html.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -2323,8 +2323,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, v = xs_dict_get(msg, "summary"); - /* is it sensitive? */ - if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { + /* if it has summary or marked as sensitive - add CW */ + /* come clients don't set "sensitive" flag properly */ + if ((!xs_is_null(v) && *v) || xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { if (xs_is_null(v) || *v == '\0') v = "..."; @@ -2344,15 +2345,6 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_text(L(" [SENSITIVE CONTENT]")))); } else { - /* print the summary as a header (sites like e.g. Friendica can contain one) */ - if (!has_title && !xs_is_null(v) && *v) { - xs_html_add(snac_content_wrap, - xs_html_tag("h3", - xs_html_attr("class", "snac-entry-title"), - xs_html_text(v))); - - has_title = 1; - } snac_content = xs_html_tag("div", NULL); } |