From 88a6a9d964e7da86406da407931e7573279126fa Mon Sep 17 00:00:00 2001 From: Oneric Date: Thu, 15 May 2025 23:07:40 +0200 Subject: [PATCH 1/2] cosmetic: replace deprecated comment syntax in eex The replacement is available since elixir 1.14.0 which matches our minimal version. --- .../web/templates/email/digest.html.eex | 20 +++++++++---------- .../templates/email/new_users_digest.html.eex | 10 +++++----- .../templates/layout/email_styled.html.eex | 4 ++-- .../templates/o_auth/o_auth/_scopes.html.eex | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/pleroma/web/templates/email/digest.html.eex b/lib/pleroma/web/templates/email/digest.html.eex index 1efc76e1a..da9775e90 100644 --- a/lib/pleroma/web/templates/email/digest.html.eex +++ b/lib/pleroma/web/templates/email/digest.html.eex @@ -231,8 +231,8 @@ <%= for %{data: mention, object: object, from: from} <- @mentions do %> - <%# mention START %> - <%# user card START %> + <%!-- mention START --%> + <%!-- user card START --%>
@@ -291,7 +291,7 @@
- <%# user card END %> + <%!-- user card END --%>
- <%# mention END %> + <%!-- mention END --%> <% end %> <%= if @followers != [] do %> - <%# new followers header START %> + <%!-- new followers header START --%>
@@ -397,10 +397,10 @@
- <%# new followers header END %> + <%!-- new followers header END --%> <%= for %{data: follow, from: from} <- @followers do %> - <%# user card START %> + <%!-- user card START --%>
@@ -459,13 +459,13 @@
- <%# user card END %> + <%!-- user card END --%> <% end %> <% end %> - <%# divider start %> + <%!-- divider start --%>
@@ -514,7 +514,7 @@
- <%# divider end %> + <%!-- divider end --%>
diff --git a/lib/pleroma/web/templates/email/new_users_digest.html.eex b/lib/pleroma/web/templates/email/new_users_digest.html.eex index 40d9b8381..74c47c652 100644 --- a/lib/pleroma/web/templates/email/new_users_digest.html.eex +++ b/lib/pleroma/web/templates/email/new_users_digest.html.eex @@ -1,5 +1,5 @@ <%= for {user, total_statuses, latest_status} <- @users_and_statuses do %> - <%# user card START %> + <%!-- user card START --%>
@@ -60,7 +60,7 @@
- <%# user card END %> + <%!-- user card END --%> <%= if latest_status do %>
@@ -104,7 +104,7 @@
<% end %> - <%# divider start %> + <%!-- divider start --%>
@@ -153,6 +153,6 @@
- <%# divider end %> - <%# user card END %> + <%!-- divider end --%> + <%!-- user card END --%> <% end %> diff --git a/lib/pleroma/web/templates/layout/email_styled.html.eex b/lib/pleroma/web/templates/layout/email_styled.html.eex index 82cabd889..3eeb52a39 100644 --- a/lib/pleroma/web/templates/layout/email_styled.html.eex +++ b/lib/pleroma/web/templates/layout/email_styled.html.eex @@ -111,7 +111,7 @@ - <%# header %> + <%!-- header --%>
@@ -145,7 +145,7 @@
- <%# title %> + <%!-- title --%> <%= if @title do %>
<%= for scope <- @available_scopes do %> - <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %> + <%!-- Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted --%> <%= if scope in @scopes do %>
<%= checkbox @form, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %> From c749df62a114c802db478baf30a89a76fb5f917c Mon Sep 17 00:00:00 2001 From: Oneric Date: Thu, 15 May 2025 23:21:21 +0200 Subject: [PATCH 2/2] cosmetic: replace deprecated Tuple.append Everytime a tuple is append a new one is allocated and all data copied over. Keeping it a list until all entries are converted avoids this. --- lib/pleroma/config_db.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/config_db.ex b/lib/pleroma/config_db.ex index 9e4e6f3ea..9c4e3eb73 100644 --- a/lib/pleroma/config_db.ex +++ b/lib/pleroma/config_db.ex @@ -303,7 +303,9 @@ def to_elixir_types(%{"tuple" => [":partial_chain", entity]}) do end def to_elixir_types(%{"tuple" => entity}) do - Enum.reduce(entity, {}, &Tuple.append(&2, to_elixir_types(&1))) + entity + |> Enum.map(&to_elixir_types(&1)) + |> List.to_tuple() end def to_elixir_types(entity) when is_map(entity) do