mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-24 18:15:19 +00:00
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/jobs
This commit is contained in:
commit
14d967f515
|
@ -12,8 +12,10 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
|||
You are using the old configuration mechanism for the frontend. Please check config.md.
|
||||
""")
|
||||
end
|
||||
end
|
||||
|
||||
if Pleroma.Config.get(:mrf_hellthread, :threshold) do
|
||||
def check_hellthread_threshold do
|
||||
if Pleroma.Config.get([:mrf_hellthread, :threshold]) do
|
||||
Logger.warn("""
|
||||
!!!DEPRECATION WARNING!!!
|
||||
You are using the old configuration mechanism for the hellthread filter. Please check config.md.
|
||||
|
@ -23,5 +25,6 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
|||
|
||||
def warn do
|
||||
check_frontend_config_mechanism()
|
||||
check_hellthread_threshold()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -102,10 +102,18 @@ defmodule Pleroma.MIME do
|
|||
"audio/ogg"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<0x52, 0x49, 0x46, 0x46, _::binary>>) do
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "WAVE", _::binary>>) do
|
||||
"audio/wav"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "WEBP", _::binary>>) do
|
||||
"image/webp"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "AVI.", _::binary>>) do
|
||||
"video/avi"
|
||||
end
|
||||
|
||||
defp check_mime_type(_) do
|
||||
@default
|
||||
end
|
||||
|
|
|
@ -182,8 +182,19 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
end
|
||||
|
||||
def render("card.json", %{rich_media: rich_media, page_url: page_url}) do
|
||||
page_url = rich_media[:url] || page_url
|
||||
page_url_data = URI.parse(page_url)
|
||||
page_url_data =
|
||||
if rich_media[:url] != nil do
|
||||
URI.merge(URI.parse(page_url), URI.parse(rich_media[:url]))
|
||||
else
|
||||
page_url
|
||||
end
|
||||
|
||||
page_url = page_url_data |> to_string
|
||||
|
||||
image_url =
|
||||
URI.merge(page_url_data, URI.parse(rich_media[:image]))
|
||||
|> to_string
|
||||
|
||||
site_name = rich_media[:site_name] || page_url_data.host
|
||||
|
||||
%{
|
||||
|
@ -191,7 +202,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
provider_name: site_name,
|
||||
provider_url: page_url_data.scheme <> "://" <> page_url_data.host,
|
||||
url: page_url,
|
||||
image: rich_media[:image] |> MediaProxy.url(),
|
||||
image: image_url |> MediaProxy.url(),
|
||||
title: rich_media[:title],
|
||||
description: rich_media[:description],
|
||||
pleroma: %{
|
||||
|
|
Loading…
Reference in a new issue