From 8a392233d22dbcdde794f1a88dcdf812385b4380 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 4 Jul 2023 15:02:04 +0200 Subject: [PATCH] The content warning check and description is propagated from the replied message. --- html.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/html.c b/html.c index 46ce5a5..4a04d7c 100644 --- a/html.c +++ b/html.c @@ -686,7 +686,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch const char *prev_src1 = xs_dict_get(msg, "sourceContent"); - if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) { + if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) { /** edit **/ xs *prev_src = xs_replace(prev_src1, "<", "<"); const xs_val *sensitive = xs_dict_get(msg, "sensitive"); const char *summary = xs_dict_get(msg, "summary"); @@ -724,7 +724,7 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch L("Sensitive content"), xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "", L("Sensitive content description"), - summary, + xs_is_null(summary) ? "" : summary, L("Only for mentioned people"), L("Attach..."), L("File"), @@ -736,10 +736,13 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch s = xs_str_cat(s, s1); } - { + { /** reply **/ /* the post textarea */ xs *ct = build_mentions(snac, msg); + const xs_val *sensitive = xs_dict_get(msg, "sensitive"); + const char *summary = xs_dict_get(msg, "summary"); + xs *s1 = xs_fmt( "

%s\n" "

\n" @@ -749,8 +752,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch "rows=\"4\" wrap=\"virtual\" required=\"required\">%s\n" "\n" - "

%s: " - "\n" + "

%s: " + "\n" "

%s: \n" "

%s\n" @@ -770,7 +773,9 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch ct, id, L("Sensitive content"), + xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "", L("Sensitive content description"), + xs_is_null(summary) ? "" : summary, L("Only for mentioned people"), L("Attach..."), L("File"),