Browse Source

New 'hide_delete_post_button' server directive.

default 7 months ago
parent
commit
36e98b8901
2 changed files with 7 additions and 1 deletions
  1. 3 0
      doc/snac.8
  2. 4 1
      html.c

+ 3 - 0
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.

+ 4 - 1
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");