aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/user')
-rw-r--r--lib/pleroma/user/notification_setting.ex13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/pleroma/user/notification_setting.ex b/lib/pleroma/user/notification_setting.ex
index 64100c0e6..f0899613e 100644
--- a/lib/pleroma/user/notification_setting.ex
+++ b/lib/pleroma/user/notification_setting.ex
@@ -9,18 +9,12 @@ defmodule Pleroma.User.NotificationSetting do
@derive Jason.Encoder
@primary_key false
- @privacy_options %{
- name_and_message: "name_and_message",
- name_only: "name_only",
- no_name_or_message: "no_name_or_message"
- }
-
embedded_schema do
field(:followers, :boolean, default: true)
field(:follows, :boolean, default: true)
field(:non_follows, :boolean, default: true)
field(:non_followers, :boolean, default: true)
- field(:privacy_option, :string, default: @privacy_options.name_and_message)
+ field(:privacy_option, :boolean, default: false)
end
def changeset(schema, params) do
@@ -32,14 +26,11 @@ defmodule Pleroma.User.NotificationSetting do
:non_followers,
:privacy_option
])
- |> validate_inclusion(:privacy_option, Map.values(@privacy_options))
end
defp prepare_attrs(params) do
Enum.reduce(params, %{}, fn
- {k, v}, acc
- when k in ["followers", "follows", "non_follows", "non_followers"] and
- is_binary(v) ->
+ {k, v}, acc when is_binary(v) ->
Map.put(acc, k, String.downcase(v))
{k, v}, acc ->