proxy emojis

(i fix emojos better than gargon but sshhhhh)
This commit is contained in:
href 2017-12-12 12:30:24 +01:00
commit f909aec050
No known key found for this signature in database
GPG key ID: EE8296C1A152C325
2 changed files with 4 additions and 1 deletions

View file

@ -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}:", "<img height='32px' width='32px' alt='#{emoji}' title='#{emoji}' src='#{file}' />")
String.replace(text, ":#{emoji}:", "<img height='32px' width='32px' alt='#{emoji}' title='#{emoji}' src='#{MediaProxy.url(file)}' />")
end)
end