Refactor notification settings

This commit is contained in:
Mark Felder 2020-05-28 10:16:09 -05:00
commit 9eea800026
8 changed files with 41 additions and 66 deletions

View file

@ -10,20 +10,18 @@ defmodule Pleroma.User.NotificationSetting do
@primary_key false
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(:from_followers, :boolean, default: true)
field(:from_following, :boolean, default: true)
field(:from_strangers, :boolean, default: true)
field(:privacy_option, :boolean, default: false)
end
def changeset(schema, params) do
schema
|> cast(prepare_attrs(params), [
:followers,
:follows,
:non_follows,
:non_followers,
:from_followers,
:from_following,
:from_strangers,
:privacy_option
])
end