correct location for emoji, woops
This commit is contained in:
parent
cb5a9662b8
commit
f63234ac04
|
@ -47,12 +47,13 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicy do
|
|||
remote_emojo = HTTPoison.get!(emojo_url)
|
||||
|
||||
if remote_emojo.status_code == 200 do
|
||||
with {:ok, current_dir} <- File.cwd() do
|
||||
emoji_dir_path = Path.join(Config.get!([:instance, :static_dir]), "emoji/stolen")
|
||||
|
||||
emojo_uri = URI.parse(emojo_url)
|
||||
extension = Path.extname(Path.basename(emojo_uri.path))
|
||||
filename = emojo_shortcode <> extension
|
||||
|
||||
new_file = Path.join([current_dir, "priv/static/emoji/stolen", filename])
|
||||
new_file = Path.join([emoji_dir_path, "priv/static/emoji/stolen", filename])
|
||||
|
||||
{:ok, file} = File.open(new_file, [:write])
|
||||
IO.binwrite(file, remote_emojo.body)
|
||||
|
@ -60,7 +61,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicy do
|
|||
Logger.debug("SAVED EMOJO")
|
||||
new_file
|
||||
end
|
||||
end
|
||||
rescue
|
||||
e in RuntimeError -> Logger.error("FAILED TO QUERY REMOTE EMOJO #{emojo_url} #{e}")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue