diff --git a/config/config.exs b/config/config.exs
index 9149e925a..e8ae31542 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -434,7 +434,7 @@
config :pleroma, :mrf_follow_bot, follower_nickname: nil
-config :pleroma, :mrf_inline_quote, prefix: "RT"
+config :pleroma, :mrf_inline_quote, template: "RT: {url}"
config :pleroma, :rich_media,
enabled: true,
diff --git a/config/description.exs b/config/description.exs
index d18649ae8..079d187d5 100644
--- a/config/description.exs
+++ b/config/description.exs
@@ -2994,6 +2994,24 @@
}
]
},
+ %{
+ group: :pleroma,
+ key: :mrf_inline_quote,
+ tab: :mrf,
+ related_policy: "Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy",
+ label: "MRF Inline Quote Policy",
+ type: :group,
+ description: "Force quote url to appear in post content.",
+ children: [
+ %{
+ key: :template,
+ type: :string,
+ description:
+ "The template to append to the post. `{url}` will be replaced with the actual link to the quoted post.",
+ suggestions: ["RT: {url}"]
+ }
+ ]
+ },
%{
group: :pleroma,
key: :modules,
diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md
index 32cc5811a..a17f8735a 100644
--- a/docs/configuration/cheatsheet.md
+++ b/docs/configuration/cheatsheet.md
@@ -269,7 +269,7 @@ Notes:
* `federated_timeline_removal_shortcode`: A list of patterns which result in message with emojis whose shortcodes match being removed from federated timelines (a.k.a unlisted). This will apply only to statuses. Each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html).
#### :mrf_inline_quote
-* `prefix`: Prefix before the link (default: `RT`)
+* `template`: The template to append to the post. `{url}` will be replaced with the actual link to the quoted post. Default: `RT: {url}`
### :activitypub
* `unfollow_blocked`: Whether blocks result in people getting unfollowed
diff --git a/lib/pleroma/web/activity_pub/mrf/inline_quote_policy.ex b/lib/pleroma/web/activity_pub/mrf/inline_quote_policy.ex
index c78675caf..a0eefefc0 100644
--- a/lib/pleroma/web/activity_pub/mrf/inline_quote_policy.ex
+++ b/lib/pleroma/web/activity_pub/mrf/inline_quote_policy.ex
@@ -6,8 +6,10 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy do
@moduledoc "Force a quote line into the message content."
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
- defp build_inline_quote(prefix, url) do
- "
#{prefix}: #{url}"
+ defp build_inline_quote(template, url) do
+ quote_line = String.replace(template, "{url}", "#{url}")
+
+ "
#{quote_line}"
end
defp has_inline_quote?(content, quote_url) do
@@ -27,14 +29,14 @@ defp filter_object(%{"quoteUrl" => quote_url} = object) do
if has_inline_quote?(content, quote_url) do
object
else
- prefix = Pleroma.Config.get([:mrf_inline_quote, :prefix])
+ template = Pleroma.Config.get([:mrf_inline_quote, :template])
content =
if String.ends_with?(content, "
Nice post
RT: https://gleasonator.com/objects/1234
Nice post
RT: https://gleasonator.com/objects/1234