summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar grunfink2025-09-30 09:50:43 +0200
committerGravatar grunfink2025-09-30 09:50:43 +0200
commit02e028b1d634fe21b2d2697d6b072ca71a6a4ce0 (patch)
treef238665cb5a84dba1defac9cdc0468d451b90974
parentBumped version. (diff)
parentCW fix (diff)
downloadpenes-snac2-02e028b1d634fe21b2d2697d6b072ca71a6a4ce0.tar.gz
penes-snac2-02e028b1d634fe21b2d2697d6b072ca71a6a4ce0.tar.xz
penes-snac2-02e028b1d634fe21b2d2697d6b072ca71a6a4ce0.zip
Merge pull request 'CW fix' (#478) from byte/snac2:fix/CW into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/478
-rw-r--r--html.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/html.c b/html.c
index 9fef9a8..777875c 100644
--- a/html.c
+++ b/html.c
@@ -2323,8 +2323,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2323 2323
2324 v = xs_dict_get(msg, "summary"); 2324 v = xs_dict_get(msg, "summary");
2325 2325
2326 /* is it sensitive? */ 2326 /* if it has summary or marked as sensitive - add CW */
2327 if (xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { 2327 /* come clients don't set "sensitive" flag properly */
2328 if ((!xs_is_null(v) && *v) || xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
2328 if (xs_is_null(v) || *v == '\0') 2329 if (xs_is_null(v) || *v == '\0')
2329 v = "..."; 2330 v = "...";
2330 2331
@@ -2344,15 +2345,6 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2344 xs_html_text(L(" [SENSITIVE CONTENT]")))); 2345 xs_html_text(L(" [SENSITIVE CONTENT]"))));
2345 } 2346 }
2346 else { 2347 else {
2347 /* print the summary as a header (sites like e.g. Friendica can contain one) */
2348 if (!has_title && !xs_is_null(v) && *v) {
2349 xs_html_add(snac_content_wrap,
2350 xs_html_tag("h3",
2351 xs_html_attr("class", "snac-entry-title"),
2352 xs_html_text(v)));
2353
2354 has_title = 1;
2355 }
2356 snac_content = xs_html_tag("div", NULL); 2348 snac_content = xs_html_tag("div", NULL);
2357 } 2349 }
2358 2350