user info: allow formdata for notification settings like every other API
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 25 May 2019 05:54:02 +0000 (05:54 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 25 May 2019 05:54:02 +0000 (05:54 +0000)
lib/pleroma/user/info.ex

index fb4cf3cc3992a99c4452fa5562f89ed5961e4c36..b0bfdf4f4c0fbf70d253d680a561bded96997788 100644 (file)
@@ -75,6 +75,11 @@ 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)