X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser%2Finfo.ex;h=a3785447c39164876ed9af74ec2551bbc44ed0e4;hb=a3003364598b42849e384a216948dad810481f51;hp=8a938e514243f3f30287d6895a7c2b5161b566a2;hpb=347df6421d6b1794a39ac6ce9e24a9e51e136a62;p=akkoma diff --git a/lib/pleroma/user/info.ex b/lib/pleroma/user/info.ex index 8a938e514..a3785447c 100644 --- a/lib/pleroma/user/info.ex +++ b/lib/pleroma/user/info.ex @@ -4,7 +4,7 @@ defmodule Pleroma.User.Info do embedded_schema do field(:banner, :map, default: %{}) - field(:background, :string, default: nil) + field(:background, :map, default: %{}) field(:source_data, :map, default: %{}) field(:note_count, :integer, default: 0) field(:follower_count, :integer, default: 0) @@ -23,7 +23,16 @@ defmodule Pleroma.User.Info do field(:uri, :string, default: nil) field(:topic, :string, default: nil) field(:hub, :string, default: nil) - # topic, subject, salmon, subscribe_address, uri + field(:salmon, :string, default: nil) + field(:hide_network, :boolean, default: false) + + # Found in the wild + # ap_id -> Where is this used? + # bio -> Where is this used? + # avatar -> Where is this used? + # fqn -> Where is this used? + # host -> Where is this used? + # subject _> Where is this used? end def set_activation_status(info, deactivated) do @@ -104,7 +113,8 @@ defmodule Pleroma.User.Info do :magic_key, :uri, :hub, - :topic + :topic, + :salmon ]) end @@ -124,7 +134,10 @@ defmodule Pleroma.User.Info do |> cast(params, [ :locked, :no_rich_text, - :default_scope + :default_scope, + :banner, + :hide_network, + :background ]) end @@ -136,6 +149,14 @@ defmodule Pleroma.User.Info do ]) end + def mastodon_settings_update(info, settings) do + params = %{settings: settings} + + info + |> cast(params, [:settings]) + |> validate_required([:settings]) + end + def set_source_data(info, source_data) do params = %{source_data: source_data}