summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/html.c b/html.c
index 5912422..fbb313b 100644
--- a/html.c
+++ b/html.c
@@ -618,17 +618,13 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int
618 if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) { 618 if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) {
619 if (xs_is_null(v = xs_dict_get(msg, "summary")) || *v == '\0') 619 if (xs_is_null(v = xs_dict_get(msg, "summary")) || *v == '\0')
620 v = "..."; 620 v = "...";
621 /* only show it when not in the public timeline and the config setting is "open" */
621 char *cw = xs_dict_get(snac->config, "cw"); 622 char *cw = xs_dict_get(snac->config, "cw");
622 if (xs_is_null(cw)) 623 if (xs_is_null(cw) || local)
623 cw = ""; 624 cw = "";
624 if (strcmp(cw, "checked") == 0) { 625 xs *s1 = xs_fmt("<details %s><summary>%s [%s]</summary>\n", cw, v, L("SENSITIVE CONTENT"));
625 xs *s1 = xs_fmt("<h3>%s</h3>", v); 626 s = xs_str_cat(s, s1);
626 s = xs_str_cat(s, s1); 627 sensitive = 1;
627 } else {
628 xs *s1 = xs_fmt("<details><summary>%s [%s]</summary>\n", v, L("SENSITIVE CONTENT"));
629 s = xs_str_cat(s, s1);
630 sensitive = 1;
631 }
632 } 628 }
633 629
634#if 0 630#if 0
@@ -1392,7 +1388,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1392 snac.config = xs_dict_set(snac.config, "bio", v); 1388 snac.config = xs_dict_set(snac.config, "bio", v);
1393 if ((v = xs_dict_get(p_vars, "cw")) != NULL && 1389 if ((v = xs_dict_get(p_vars, "cw")) != NULL &&
1394 strcmp(v, "on") == 0) { 1390 strcmp(v, "on") == 0) {
1395 snac.config = xs_dict_set(snac.config, "cw", "checked"); 1391 snac.config = xs_dict_set(snac.config, "cw", "open");
1396 } else { /* if the checkbox is not set, the parameter is missing */ 1392 } else { /* if the checkbox is not set, the parameter is missing */
1397 snac.config = xs_dict_set(snac.config, "cw", ""); 1393 snac.config = xs_dict_set(snac.config, "cw", "");
1398 } 1394 }