From 1aab2f1b97e0b4101f5b22d5a02ac5bbf485050b Mon Sep 17 00:00:00 2001
From: trisua <me@trisua.com>
Date: Wed, 18 Jun 2025 21:32:05 -0400
Subject: [PATCH] add: make hide_dislikes disable post dislikes entirely

---
 crates/app/src/public/html/components.lisp       | 6 +++---
 crates/app/src/public/html/profile/settings.lisp | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/crates/app/src/public/html/components.lisp b/crates/app/src/public/html/components.lisp
index 02dcc59..d5b6805 100644
--- a/crates/app/src/public/html/components.lisp
+++ b/crates/app/src/public/html/components.lisp
@@ -72,7 +72,7 @@
     ("style" "display: contents")
     (text "{% if user.settings.display_name -%} {{ user.settings.display_name }} {% else %} {{ user.username }} {%- endif %}"))
 
-(text "{%- endmacro %} {% macro likes(id, asset_type, likes=0, dislikes=0, secondary=false) -%}")
+(text "{%- endmacro %} {% macro likes(id, asset_type, likes=0, dislikes=0, secondary=false, disable_dislikes=false) -%}")
 (button
     ("title" "Like")
     ("class" "{% if secondary -%}lowered{% else %}camo{%- endif %} small")
@@ -83,7 +83,7 @@
         (text "{{ likes }}"))
     (text "{%- endif %}"))
 
-(text "{% if not user or not user.settings.hide_dislikes -%}")
+(text "{% if not user or not user.settings.hide_dislikes and not disable_dislikes -%}")
 (button
     ("title" "Dislike")
     ("class" "{% if secondary -%}lowered{% else %}camo{%- endif %} small")
@@ -289,7 +289,7 @@
                 ("class" "flex gap-1 reactions_box")
                 ("hook" "check_reactions")
                 ("hook-arg:id" "{{ post.id }}")
-                (text "{% if post.context.reactions_enabled -%} {% if post.content|length > 0 or post.uploads|length > 0 -%} {{ self::likes(id=post.id, asset_type=\"Post\", likes=post.likes, dislikes=post.dislikes) }} {%- endif %} {%- endif %}  {% if post.context.repost and post.context.repost.reposting -%}")
+                (text "{% if post.context.reactions_enabled -%} {% if post.content|length > 0 or post.uploads|length > 0 -%} {{ self::likes(id=post.id, asset_type=\"Post\", likes=post.likes, dislikes=post.dislikes, disable_dislikes=owner.settings.hide_dislikes) }} {%- endif %} {%- endif %}  {% if post.context.repost and post.context.repost.reposting -%}")
                 (a
                     ("href" "/post/{{ post.context.repost.reposting }}")
                     ("class" "button small camo")
diff --git a/crates/app/src/public/html/profile/settings.lisp b/crates/app/src/public/html/profile/settings.lisp
index bb0277d..8be4836 100644
--- a/crates/app/src/public/html/profile/settings.lisp
+++ b/crates/app/src/public/html/profile/settings.lisp
@@ -1398,7 +1398,7 @@
                     ],
                     [
                         [],
-                        \"Hides dislikes on all posts. Users can still dislike your posts, you just won't be able to see it.\",
+                        \"Hides dislikes on all posts. Users will also no longer be able to dislike your posts.\",
                         \"text\",
                     ],
                     [[], \"Fun\", \"title\"],