From: href Date: Tue, 12 Dec 2017 11:30:24 +0000 (+0100) Subject: proxy emojis X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f909aec050498a366d8b0ed6c1b5439b5b0891f1;p=akkoma proxy emojis (i fix emojos better than gargon but sshhhhh) --- diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index c98db2d94..eed5b5786 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -1,5 +1,6 @@ defmodule Pleroma.Formatter do alias Pleroma.User + alias Pleroma.Web.MediaProxy @link_regex ~r/https?:\/\/[\w\.\/?=\-#%&@~\(\)]+[\w\/]/u def linkify(text) do @@ -125,7 +126,7 @@ defmodule Pleroma.Formatter do end Enum.reduce(all_emoji, text, fn ({emoji, file}, text) -> - String.replace(text, ":#{emoji}:", "#{emoji}") + String.replace(text, ":#{emoji}:", "#{emoji}") end) end diff --git a/lib/pleroma/web/media_proxy/media_proxy.ex b/lib/pleroma/web/media_proxy/media_proxy.ex index 21ebdfbbc..23efc18fa 100644 --- a/lib/pleroma/web/media_proxy/media_proxy.ex +++ b/lib/pleroma/web/media_proxy/media_proxy.ex @@ -3,6 +3,8 @@ defmodule Pleroma.Web.MediaProxy do def url(nil), do: nil + def url(url = "/" <> _), do: url + def url(url) do config = Application.get_env(:pleroma, :media_proxy, []) if !Keyword.get(config, :enabled, false) or String.starts_with?(url, Pleroma.Web.base_url) do