summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/html.c b/html.c
index 43638d5..811aeba 100644
--- a/html.c
+++ b/html.c
@@ -444,6 +444,8 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
444 char *type = xs_dict_get(msg, "type"); 444 char *type = xs_dict_get(msg, "type");
445 char *meta = xs_dict_get(msg, "_snac"); 445 char *meta = xs_dict_get(msg, "_snac");
446 char *actor; 446 char *actor;
447 int sensitive = 0;
448 char *v;
447 449
448 /* do not show non-public messages in the public timeline */ 450 /* do not show non-public messages in the public timeline */
449 if (local && !is_msg_public(snac, msg)) 451 if (local && !is_msg_public(snac, msg))
@@ -563,6 +565,17 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
563 /* add the content */ 565 /* add the content */
564 s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n"); 566 s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n");
565 567
568 /* is it sensitive? */
569 if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) {
570 if (xs_is_null(v = xs_dict_get(msg, "summary")) || *v == '\0')
571 v = "...";
572
573 xs *s1 = xs_fmt("<details><summary>%s [%s]</summary>\n", v, L("SENSITIVE CONTENT"));
574 s = xs_str_cat(s, s1);
575
576 sensitive = 1;
577 }
578
566 { 579 {
567 xs *c = xs_dup(xs_dict_get(msg, "content")); 580 xs *c = xs_dup(xs_dict_get(msg, "content"));
568 char *p, *v; 581 char *p, *v;
@@ -642,6 +655,9 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
642 } 655 }
643 } 656 }
644 657
658 if (sensitive)
659 s = xs_str_cat(s, "</details><p>\n");
660
645 s = xs_str_cat(s, "</div>\n"); 661 s = xs_str_cat(s, "</div>\n");
646 662
647 /** controls **/ 663 /** controls **/