aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/user
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-06-02 08:25:37 +0000
committerkaniini <nenolod@gmail.com>2019-06-02 08:25:37 +0000
commit5402d04e3cd2d45472092942fec2c9302c48f64f (patch)
tree1660d3314df49577102f26ec2025207953ff2306 /lib/pleroma/user
parente706b42f519fe754af980fc758be492b24e3ccde (diff)
parent45e4642a58f5299d2cd3f142aea110a474eb477f (diff)
downloadpleroma-5402d04e3cd2d45472092942fec2c9302c48f64f.tar.gz
Merge branch 'feature/notification-control-part-2' into 'develop'
notification controls, part 2 See merge request pleroma/pleroma!1204
Diffstat (limited to 'lib/pleroma/user')
-rw-r--r--lib/pleroma/user/info.ex14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/pleroma/user/info.ex b/lib/pleroma/user/info.ex
index ef506c8da..88bec76a7 100644
--- a/lib/pleroma/user/info.ex
+++ b/lib/pleroma/user/info.ex
@@ -46,7 +46,12 @@ defmodule Pleroma.User.Info do
field(:emoji, {:array, :map}, default: [])
field(:notification_settings, :map,
- default: %{"remote" => true, "local" => true, "followers" => true, "follows" => true}
+ default: %{
+ "followers" => true,
+ "follows" => true,
+ "non_follows" => true,
+ "non_followers" => true
+ }
)
# Found in the wild
@@ -67,10 +72,15 @@ defmodule Pleroma.User.Info do
end
def update_notification_settings(info, settings) do
+ settings =
+ settings
+ |> Enum.map(fn {k, v} -> {k, v in [true, "true", "True", "1"]} end)
+ |> Map.new()
+
notification_settings =
info.notification_settings
|> Map.merge(settings)
- |> Map.take(["remote", "local", "followers", "follows"])
+ |> Map.take(["followers", "follows", "non_follows", "non_followers"])
params = %{notification_settings: notification_settings}