Add API endpoints for a custom user mascot
This commit is contained in:
parent
b30b51c3b7
commit
54e9cb5c2d
4 changed files with 98 additions and 1 deletions
|
|
@ -43,6 +43,19 @@ defmodule Pleroma.User.Info do
|
|||
field(:hide_favorites, :boolean, default: true)
|
||||
field(:pinned_activities, {:array, :string}, default: [])
|
||||
field(:flavour, :string, default: nil)
|
||||
|
||||
field(:mascot, :map,
|
||||
default: %{
|
||||
id: "pleromatan",
|
||||
url: "/images/pleroma-fox-tan-smol.png",
|
||||
type: "image",
|
||||
preview_url: "/images/pleroma-fox-tan-smol.png",
|
||||
pleroma: %{
|
||||
mime_type: "image/png"
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
field(:emoji, {:array, :map}, default: [])
|
||||
|
||||
field(:notification_settings, :map,
|
||||
|
|
@ -248,6 +261,14 @@ defmodule Pleroma.User.Info do
|
|||
|> validate_required([:flavour])
|
||||
end
|
||||
|
||||
def mascot_update(info, url) do
|
||||
params = %{mascot: url}
|
||||
|
||||
info
|
||||
|> cast(params, [:mascot])
|
||||
|> validate_required([:mascot])
|
||||
end
|
||||
|
||||
def set_source_data(info, source_data) do
|
||||
params = %{source_data: source_data}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue