1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.User.NotificationSetting do
13 field(:followers, :boolean, default: true)
14 field(:follows, :boolean, default: true)
15 field(:non_follows, :boolean, default: true)
16 field(:non_followers, :boolean, default: true)
17 field(:privacy_option, :boolean, default: false)
20 def changeset(schema, params) do
22 |> cast(prepare_attrs(params), [
31 defp prepare_attrs(params) do
32 Enum.reduce(params, %{}, fn
33 {k, v}, acc when is_binary(v) ->
34 Map.put(acc, k, String.downcase(v))