From 36e98b890166d900ea630b97c520a0f189d96bc0 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 31 Aug 2024 08:22:30 +0200 Subject: [PATCH] New 'hide_delete_post_button' server directive. --- doc/snac.8 | 3 +++ html.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/snac.8 b/doc/snac.8 index e7179d8..ab1bc24 100644 --- 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 index ca14d45..0b13602 100644 --- 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");