Make attachment links configurable
authorMark Felder <feld@FreeBSD.org>
Thu, 17 Jan 2019 15:48:14 +0000 (15:48 +0000)
committerMark Felder <feld@FreeBSD.org>
Thu, 17 Jan 2019 15:48:14 +0000 (15:48 +0000)
Thanks @href!

docs/config.md
lib/pleroma/web/common_api/common_api.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index e3738271bbb03a20e60aebe043cb49b41e7b7e69..6bf7b9ea7da76e9b568f84dd9bcf7a8e88c7a73d 100644 (file)
@@ -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
index 2902905fd399c3c939aba11e49eb1dfc71f9b998..7d2ac3b0f25f2feef6277ec3e454856645058ee7 100644 (file)
@@ -103,7 +103,7 @@ 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], true)))
            ),
          context <- make_context(inReplyTo),
          cw <- data["spoiler_text"],
index a8fe9d7081e9c0192f0c831eb6c1b7f1df5985d0..daad891856b168bac828a2db38bd18ddbc46cf06 100644 (file)
@@ -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