X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser%2Fnotification_setting.ex;h=4bd55e139d2c8c916f3ca5020e06dfaa5033aa3b;hb=46dd276d686e49676101e2af743aad61393f4b70;hp=64100c0e63ff37c0ff61b46f7da5700d16f75c23;hpb=a52da55eb9c6bbf8a08bf1d90d59a48dc25f5907;p=akkoma
diff --git a/lib/pleroma/user/notification_setting.ex b/lib/pleroma/user/notification_setting.ex
index 64100c0e6..4bd55e139 100644
--- a/lib/pleroma/user/notification_setting.ex
+++ b/lib/pleroma/user/notification_setting.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.User.NotificationSetting do
@@ -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 ->