From bcee3f77630ecbac43b579a5531ca18210dd7652 Mon Sep 17 00:00:00 2001 From: trisua Date: Sun, 10 Aug 2025 16:20:23 -0400 Subject: [PATCH] add: require that users keep supporter status for profilestyle products --- crates/app/src/public/html/components.lisp | 5 ++--- crates/core/src/database/auth.rs | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/app/src/public/html/components.lisp b/crates/app/src/public/html/components.lisp index c7fe864..a0e89bb 100644 --- a/crates/app/src/public/html/components.lisp +++ b/crates/app/src/public/html/components.lisp @@ -624,9 +624,8 @@ (div ("class" "flex items_center") (b - (text "{{ self::full_username(user=user, max_width=\"calc(100% - 42px - var(--pad-4))\") }}")) + (text "{{ self::full_username(user=user) }}")) (text "{{ self::online_indicator(user=user) }}")))) - (text "{%- endmacro %} {% macro pagination(page=0, items=0, key=\"\", value=\"\") -%}") (div ("class" "flex justify_between gap_2 w_full") @@ -1359,7 +1358,7 @@ (text "{{ self::avatar(username=user.username, size=\"42px\", selector_type=\"username\") }}")) (div ("class" "flex justify_center flex_col") - ("style" "{% if show_menu or show_kick -%}width: 60%{% else %}max-width: 150px{%- endif %}") + ("style" "{% if show_menu or show_kick -%}width: 60%{% else %}max-width: calc(100% - 42px - var(--pad-4)){%- endif %}") (text "{{ self::full_username(user=user) }}") (div ("class" "user_status") diff --git a/crates/core/src/database/auth.rs b/crates/core/src/database/auth.rs index 178fb29..ce183a4 100644 --- a/crates/core/src/database/auth.rs +++ b/crates/core/src/database/auth.rs @@ -1098,10 +1098,19 @@ impl DataManager { let mut out = Vec::new(); for config in &user.applied_configurations { - let product = match self.get_product_by_id(config.1).await { - Ok(x) => x, - Err(_) => continue, - }; + let product = self.get_product_by_id(config.1).await?; + let owner = self.get_user_by_id_with_void(product.owner).await?; + + if config.0 == AppliedConfigType::StyleSnippet + && !owner.permissions.check(FinePermission::SUPPORTER) + { + out.push(format!( + "", + owner.username + )); + + continue; + } out.push(match config.0 { AppliedConfigType::StyleSnippet => {