summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/html.c b/html.c
index ea75256..42a4a4e 100644
--- a/html.c
+++ b/html.c
@@ -1388,9 +1388,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local,
1388 1388
1389 xs_html *snac_content = NULL; 1389 xs_html *snac_content = NULL;
1390 1390
1391 v = xs_dict_get(msg, "summary");
1392
1391 /* is it sensitive? */ 1393 /* is it sensitive? */
1392 if (user && xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) { 1394 if (user && xs_type(xs_dict_get(msg, "sensitive")) == XSTYPE_TRUE) {
1393 if (xs_is_null(v = xs_dict_get(msg, "summary")) || *v == '\0') 1395 if (xs_is_null(v) || *v == '\0')
1394 v = "..."; 1396 v = "...";
1395 1397
1396 /* only show it when not in the public timeline and the config setting is "open" */ 1398 /* only show it when not in the public timeline and the config setting is "open" */
@@ -1404,8 +1406,16 @@ xs_html *html_entry(snac *user, xs_dict *msg, int local,
1404 xs_html_text(v), 1406 xs_html_text(v),
1405 xs_html_text(L(" [SENSITIVE CONTENT]")))); 1407 xs_html_text(L(" [SENSITIVE CONTENT]"))));
1406 } 1408 }
1407 else 1409 else {
1410 /* print the summary as a header (sites like e.g. Friendica can contain one) */
1411 if (!xs_is_null(v) && *v)
1412 xs_html_add(snac_content_wrap,
1413 xs_html_tag("h3",
1414 xs_html_attr("class", "snac-entry-title"),
1415 xs_html_text(v)));
1416
1408 snac_content = xs_html_tag("div", NULL); 1417 snac_content = xs_html_tag("div", NULL);
1418 }
1409 1419
1410 xs_html_add(snac_content_wrap, 1420 xs_html_add(snac_content_wrap,
1411 snac_content); 1421 snac_content);