Transmogrifier: fix quoteUrl here too
This commit is contained in:
parent
b022d6635d
commit
cc4badaf60
1 changed files with 19 additions and 4 deletions
|
@ -166,9 +166,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
|
|
||||||
def fix_in_reply_to(object, _options), do: object
|
def fix_in_reply_to(object, _options), do: object
|
||||||
|
|
||||||
def fix_quote(object, options \\ [])
|
def fix_quote_url(object, options \\ [])
|
||||||
|
|
||||||
def fix_quote(%{"quoteUrl" => quote_url} = object, options)
|
def fix_quote_url(%{"quoteUrl" => quote_url} = object, options)
|
||||||
when not is_nil(quote_url) do
|
when not is_nil(quote_url) do
|
||||||
with {:ok, quoted_object} <- get_obj_helper(quote_url, options),
|
with {:ok, quoted_object} <- get_obj_helper(quote_url, options),
|
||||||
%Activity{} <- Activity.get_create_by_object_ap_id(quoted_object.data["id"]) do
|
%Activity{} <- Activity.get_create_by_object_ap_id(quoted_object.data["id"]) do
|
||||||
|
@ -180,7 +180,22 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_quote(object, _options), do: object
|
# Fix for Fedibird
|
||||||
|
# https://github.com/fedibird/mastodon/issues/9
|
||||||
|
def fix_quote_url(%{"quoteURL" => quote_url} = object, options) do
|
||||||
|
object
|
||||||
|
|> Map.put("quoteUrl", quote_url)
|
||||||
|
|> fix_quote_url(options)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Misskey fallback
|
||||||
|
def fix_quote_url(%{"_misskey_quote" => quote_url} = object, options) do
|
||||||
|
object
|
||||||
|
|> Map.put("quoteUrl", quote_url)
|
||||||
|
|> fix_quote_url(options)
|
||||||
|
end
|
||||||
|
|
||||||
|
def fix_quote_url(object, _options), do: object
|
||||||
|
|
||||||
defp prepare_in_reply_to(in_reply_to) do
|
defp prepare_in_reply_to(in_reply_to) do
|
||||||
cond do
|
cond do
|
||||||
|
@ -470,7 +485,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
|> strip_internal_fields()
|
|> strip_internal_fields()
|
||||||
|> fix_type(fetch_options)
|
|> fix_type(fetch_options)
|
||||||
|> fix_in_reply_to(fetch_options)
|
|> fix_in_reply_to(fetch_options)
|
||||||
|> fix_quote(fetch_options)
|
|> fix_quote_url(fetch_options)
|
||||||
|
|
||||||
data = Map.put(data, "object", object)
|
data = Map.put(data, "object", object)
|
||||||
options = Keyword.put(options, :local, false)
|
options = Keyword.put(options, :local, false)
|
||||||
|
|
Loading…
Reference in a new issue