snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 36e98b890166d900ea630b97c520a0f189d96bc0
parent 5e5abd76a0e19facf191d9663ab89053d43d8df8
Author: default <nobody@localhost>
Date:   Sat, 31 Aug 2024 08:22:30 +0200

New 'hide_delete_post_button' server directive.

Diffstat:
Mdoc/snac.8 | 3+++
Mhtml.c | 5++++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/snac.8 b/doc/snac.8 @@ -227,6 +227,9 @@ set, it defaults to "https". If you run as part of a hidden network like Tor or I2P that doesn't have a TLS / Certificate infrastructure, you need to set it to "http". Don't change it unless you know what you are doing. +.It Ic hide_delete_post_button +If set to true, the button to delete a post is not shown. It's not very +useful and somewhat clutters the already crowded button space. .El .Pp You must restart the server to make effective these changes. diff --git a/html.c b/html.c @@ -1367,8 +1367,11 @@ xs_html *html_entry_controls(snac *snac, const char *actor, L("Block any activity from this user forever"))); } + if (!xs_is_true(xs_dict_get(srv_config, "hide_delete_post_button"))) + xs_html_add(form, + html_button("delete", L("Delete"), L("Delete this post"))); + xs_html_add(form, - html_button("delete", L("Delete"), L("Delete this post")), html_button("hide", L("Hide"), L("Hide this post and its children"))); const char *prev_src = xs_dict_get(msg, "sourceContent");