diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/admin_api/views/account_view.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/operations/account_operation.ex | 6 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/operations/media_operation.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/schemas/account.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/schemas/attachment.ex | 6 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/schemas/chat.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/schemas/status.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/account_view.ex | 1 |
10 files changed, 21 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index bcd5256c8..073f537be 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -138,6 +138,7 @@ defmodule Pleroma.User do field(:is_discoverable, :boolean, default: false) field(:invisible, :boolean, default: false) field(:allow_following_move, :boolean, default: true) + field(:show_attachment_filenames, :boolean, default: false) field(:skip_thread_containment, :boolean, default: false) field(:actor_type, :string, default: "Person") field(:also_known_as, {:array, :string}, default: []) @@ -503,6 +504,7 @@ defmodule Pleroma.User do :allow_following_move, :background, :show_role, + :show_attachment_filenames, :skip_thread_containment, :fields, :raw_fields, diff --git a/lib/pleroma/web/admin_api/views/account_view.ex b/lib/pleroma/web/admin_api/views/account_view.ex index 8bac24d3e..7f86c001d 100644 --- a/lib/pleroma/web/admin_api/views/account_view.ex +++ b/lib/pleroma/web/admin_api/views/account_view.ex @@ -48,6 +48,7 @@ defmodule Pleroma.Web.AdminAPI.AccountView do :hide_followers, :hide_favorites, :allow_following_move, + :show_attachment_filenames, :show_role, :skip_thread_containment, :pleroma_settings_store, diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex index 280100c3d..0f04721b0 100644 --- a/lib/pleroma/web/api_spec/operations/account_operation.ex +++ b/lib/pleroma/web/api_spec/operations/account_operation.ex @@ -604,6 +604,11 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do nullable: true, description: "Opaque user settings to be saved on the backend." }, + show_attachment_filenames: %Schema{ + allOf: [BooleanLike], + nullable: true, + description: "Show the attachment filenames" + }, skip_thread_containment: %Schema{ allOf: [BooleanLike], nullable: true, @@ -642,6 +647,7 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do show_role: false, default_scope: "private", pleroma_settings_store: %{"pleroma-fe" => %{"key" => "val"}}, + show_attachment_filenames: false, skip_thread_containment: false, allow_following_move: false, discoverable: false, diff --git a/lib/pleroma/web/api_spec/operations/media_operation.ex b/lib/pleroma/web/api_spec/operations/media_operation.ex index cfd436f27..4c1496dd7 100644 --- a/lib/pleroma/web/api_spec/operations/media_operation.ex +++ b/lib/pleroma/web/api_spec/operations/media_operation.ex @@ -48,6 +48,7 @@ defmodule Pleroma.Web.ApiSpec.MediaOperation do }, filename: %Schema{ type: :string, + nullable: true, description: "Filename of the media." }, focus: %Schema{ diff --git a/lib/pleroma/web/api_spec/schemas/account.ex b/lib/pleroma/web/api_spec/schemas/account.ex index 684f6fc92..996d15303 100644 --- a/lib/pleroma/web/api_spec/schemas/account.ex +++ b/lib/pleroma/web/api_spec/schemas/account.ex @@ -76,6 +76,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do type: :boolean, description: "whether the user is a moderator of the local instance" }, + show_attachment_filenames: %Schema{type: :boolean}, skip_thread_containment: %Schema{type: :boolean}, tags: %Schema{ type: :array, @@ -172,6 +173,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do "hide_follows_count" => false, "is_admin" => false, "is_moderator" => false, + "show_attachment_filenames" => false, "skip_thread_containment" => false, "accepts_chat_messages" => true, "chat_token" => diff --git a/lib/pleroma/web/api_spec/schemas/attachment.ex b/lib/pleroma/web/api_spec/schemas/attachment.ex index c2984546a..5695abf71 100644 --- a/lib/pleroma/web/api_spec/schemas/attachment.ex +++ b/lib/pleroma/web/api_spec/schemas/attachment.ex @@ -51,7 +51,11 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Attachment do type: :object, properties: %{ mime_type: %Schema{type: :string, description: "mime type of the attachment"}, - filename: %Schema{type: :string, description: "filename of the attachment"} + filename: %Schema{ + type: :string, + nullable: true, + description: "filename of the attachment" + } } } }, diff --git a/lib/pleroma/web/api_spec/schemas/chat.ex b/lib/pleroma/web/api_spec/schemas/chat.ex index 65f908e33..b50d4f7e7 100644 --- a/lib/pleroma/web/api_spec/schemas/chat.ex +++ b/lib/pleroma/web/api_spec/schemas/chat.ex @@ -31,6 +31,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do "hide_follows_count" => false, "hide_follows" => false, "background_image" => nil, + "show_attachment_filenames" => false, "skip_thread_containment" => false, "hide_followers" => false, "relationship" => %{}, diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex index e6890df2d..d7665c043 100644 --- a/lib/pleroma/web/api_spec/schemas/status.ex +++ b/lib/pleroma/web/api_spec/schemas/status.ex @@ -278,6 +278,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do "showing_reblogs" => true, "subscribing" => false }, + "show_attachment_filenames" => false, "skip_thread_containment" => false, "tags" => [] }, diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 7011b7eb1..0bc37fff4 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -182,6 +182,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do :hide_followers, :hide_follows, :hide_favorites, + :show_attachment_filenames, :show_role, :skip_thread_containment, :allow_following_move, diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index 3158d09ed..9e5d087e3 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -277,6 +277,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do hide_follows: user.hide_follows, hide_favorites: user.hide_favorites, relationship: relationship, + show_attachment_filenames: user.show_attachment_filenames, skip_thread_containment: user.skip_thread_containment, background_image: image_url(user.background) |> MediaProxy.url(), accepts_chat_messages: user.accepts_chat_messages, |