commit: f73b5bd05f26d881bcae8f374b1472a420ff77ea
parent: 9fa761620d7c975db712da2e0b9a93feab6fd3cf
Author: kaniini <nenolod@gmail.com>
Date: Thu, 17 Jan 2019 19:21:54 +0000
Merge branch 'attachment-links' into 'develop'
Make attachment links configurable
See merge request pleroma/pleroma!677
Diffstat:
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/config/config.exs b/config/config.exs
@@ -139,7 +139,8 @@ config :pleroma, :instance,
finmoji_enabled: true,
mrf_transparency: true,
autofollowed_nicknames: [],
- max_pinned_statuses: 1
+ max_pinned_statuses: 1,
+ no_attachment_links: false
config :pleroma, :markup,
# XXX - unfortunately, inline images must be enabled by default right now, because
diff --git a/docs/config.md b/docs/config.md
@@ -95,6 +95,7 @@ config :pleroma, Pleroma.Mailer,
older software for theses nicknames.
* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature.
* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow.
+* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses
## :logger
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
@@ -103,7 +103,14 @@ defmodule Pleroma.Web.CommonAPI do
attachments,
tags,
get_content_type(data["content_type"]),
- Enum.member?([true, "true"], data["no_attachment_links"])
+ Enum.member?(
+ [true, "true"],
+ Map.get(
+ data,
+ "no_attachment_links",
+ Pleroma.Config.get([:instance, :no_attachment_links], false)
+ )
+ )
),
context <- make_context(inReplyTo),
cw <- data["spoiler_text"],
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -341,7 +341,6 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
params =
params
|> Map.put("in_reply_to_status_id", params["in_reply_to_id"])
- |> Map.put("no_attachment_links", true)
idempotency_key =
case get_req_header(conn, "idempotency-key") do