From: Ilja Date: Mon, 7 Mar 2022 13:00:42 +0000 (+0100) Subject: After code review X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a20d2847e2959d4fce86757057a680f0fcfa87ec;p=akkoma After code review Use patern matching to see if someone was superuser before --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 809524f56..27ed9bbc5 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1099,11 +1099,8 @@ defmodule Pleroma.User do |> maybe_remove_report_notifications(was_superuser_before_update) end - defp maybe_remove_report_notifications( - {:ok, %Pleroma.User{} = user} = result, - was_superuser_before_update - ) do - if was_superuser_before_update and not User.superuser?(user), + defp maybe_remove_report_notifications({:ok, %Pleroma.User{} = user} = result, true) do + if not User.superuser?(user), do: user |> Notification.destroy_multiple_from_types(["pleroma:report"]) result