Merge branch 'develop' into 'fix/rename-no_attachment_links-setting'

# Conflicts:
#   config/description.exs
This commit is contained in:
feld 2020-02-13 14:37:55 +00:00
commit b312c36b8e
3 changed files with 46 additions and 20 deletions

View file

@ -637,22 +637,24 @@
%{ %{
key: :registrations_open, key: :registrations_open,
type: :boolean, type: :boolean,
description: "Enable registrations for anyone, invitations can be enabled when `false`" description:
"Enable registrations for anyone. Invitations require this setting to be disabled."
}, },
%{ %{
key: :invites_enabled, key: :invites_enabled,
type: :boolean, type: :boolean,
description: "Enable user invitations for admins (depends on `registrations_open: false`)" description:
"Enable user invitations for admins (depends on `registrations_open` being disabled)."
}, },
%{ %{
key: :account_activation_required, key: :account_activation_required,
type: :boolean, type: :boolean,
description: "Require users to confirm their emails before signing in" description: "Require users to confirm their emails before signing in."
}, },
%{ %{
key: :federating, key: :federating,
type: :boolean, type: :boolean,
description: "Enable federation with other instances" description: "Enable federation with other instances."
}, },
%{ %{
key: :federation_incoming_replies_max_depth, key: :federation_incoming_replies_max_depth,
@ -761,14 +763,14 @@
key: :extended_nickname_format, key: :extended_nickname_format,
type: :boolean, type: :boolean,
description: description:
"Set to `true` to use extended local nicknames format (allows underscores/dashes)." <> "Enable to use extended local nicknames format (allows underscores/dashes)." <>
" This will break federation with older software for theses nicknames." " This will break federation with older software for theses nicknames."
}, },
%{ %{
key: :cleanup_attachments, key: :cleanup_attachments,
type: :boolean, type: :boolean,
description: """ description: """
"Set to `true` to remove associated attachments when status is removed. "Enable to remove associated attachments when status is removed.
This will not affect duplicates and attachments without status. This will not affect duplicates and attachments without status.
Enabling this will increase load to database when deleting statuses on larger instances. Enabling this will increase load to database when deleting statuses on larger instances.
""" """
@ -829,14 +831,14 @@
key: :safe_dm_mentions, key: :safe_dm_mentions,
type: :boolean, type: :boolean,
description: description:
"If set to `true`, only mentions at the beginning of a post will be used to address people in direct messages." <> "If enabled, only mentions at the beginning of a post will be used to address people in direct messages." <>
" This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <> " This is to prevent accidental mentioning of people when talking about them (e.g. \"@admin please keep an eye on @bad_actor\")." <>
" Default: `false`" " Default: disabled"
}, },
%{ %{
key: :healthcheck, key: :healthcheck,
type: :boolean, type: :boolean,
description: "If set to `true`, system data will be shown on /api/pleroma/healthcheck" description: "If enabled, system data will be shown on /api/pleroma/healthcheck"
}, },
%{ %{
key: :remote_post_retention_days, key: :remote_post_retention_days,
@ -866,7 +868,7 @@
%{ %{
key: :skip_thread_containment, key: :skip_thread_containment,
type: :boolean, type: :boolean,
description: "Skip filter out broken threads. Default: `true`" description: "Skip filtering out broken threads. Default: enabled"
}, },
%{ %{
key: :limit_to_local_content, key: :limit_to_local_content,
@ -1158,17 +1160,15 @@
key: :alwaysShowSubjectInput, key: :alwaysShowSubjectInput,
label: "Always show subject input", label: "Always show subject input",
type: :boolean, type: :boolean,
description: "When set to `false`, auto-hide the subject field when it's empty" description: "When disabled, auto-hide the subject field if it's empty"
}, },
%{ %{
key: :logoMask, key: :logoMask,
label: "Logo mask", label: "Logo mask",
type: :boolean, type: :boolean,
description: description:
"By default it assumes logo used will be monochrome-with-alpha one, this is done to be compatible with both light and dark themes, " <> "By default it assumes logo used will be monochrome with alpha channel to be compatible with both light and dark themes. " <>
"so that white logo designed with dark theme in mind won't be invisible over light theme, this is done via CSS3 Masking. " <> "If you want a colorful logo you must disable logoMask."
"Basically - it will take alpha channel of the image and fill non-transparent areas of it with solid color. " <>
"If you really want colorful logo - it can be done by setting logoMask to false."
}, },
%{ %{
key: :logoMargin, key: :logoMargin,
@ -1182,13 +1182,13 @@
%{ %{
key: :stickers, key: :stickers,
type: :boolean, type: :boolean,
description: "Enables/disables stickers." description: "Enables stickers."
}, },
%{ %{
key: :enableEmojiPicker, key: :enableEmojiPicker,
label: "Emoji picker", label: "Emoji picker",
type: :boolean, type: :boolean,
description: "Enables/disables emoji picker." description: "Enables emoji picker."
} }
] ]
}, },
@ -2085,7 +2085,7 @@
key: :unfurl_nsfw, key: :unfurl_nsfw,
label: "Unfurl NSFW", label: "Unfurl NSFW",
type: :boolean, type: :boolean,
description: "If set to `true` NSFW attachments will be shown in previews" description: "When enabled NSFW attachments will be shown in previews"
} }
] ]
}, },
@ -2357,7 +2357,7 @@
type: :boolean, type: :boolean,
description: description:
"OAuth admin scope requirement toggle. " <> "OAuth admin scope requirement toggle. " <>
"If `true`, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <> "If enabled, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token " <>
"(client app must support admin scopes). If `false` and token doesn't have admin scope(s)," <> "(client app must support admin scopes). If `false` and token doesn't have admin scope(s)," <>
"`is_admin` user flag grants access to admin-specific actions." "`is_admin` user flag grants access to admin-specific actions."
}, },

View file

@ -62,6 +62,6 @@ def validate_scheduled_at(changeset) do
def expires_late_enough?(scheduled_at) do def expires_late_enough?(scheduled_at) do
now = NaiveDateTime.utc_now() now = NaiveDateTime.utc_now()
diff = NaiveDateTime.diff(scheduled_at, now, :millisecond) diff = NaiveDateTime.diff(scheduled_at, now, :millisecond)
diff >= @min_activity_lifetime diff > @min_activity_lifetime
end end
end end

View file

@ -121,6 +121,32 @@ test "posting a status", %{conn: conn} do
NaiveDateTime.to_iso8601(expiration.scheduled_at) NaiveDateTime.to_iso8601(expiration.scheduled_at)
end end
test "it fails to create a status if `expires_in` is less or equal than an hour", %{
conn: conn
} do
# 1 hour
expires_in = 60 * 60
assert %{"error" => "Expiry date is too soon"} =
conn
|> post("api/v1/statuses", %{
"status" => "oolong",
"expires_in" => expires_in
})
|> json_response(422)
# 30 minutes
expires_in = 30 * 60
assert %{"error" => "Expiry date is too soon"} =
conn
|> post("api/v1/statuses", %{
"status" => "oolong",
"expires_in" => expires_in
})
|> json_response(422)
end
test "posting an undefined status with an attachment", %{user: user, conn: conn} do test "posting an undefined status with an attachment", %{user: user, conn: conn} do
file = %Plug.Upload{ file = %Plug.Upload{
content_type: "image/jpg", content_type: "image/jpg",