twitter/mastodon api: always use mediaproxy URLs in attachments
if using local media, the mediaproxy will not replace the URL anyway.
This commit is contained in:
parent
658036881d
commit
5c6ec2d9fc
2 changed files with 5 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
|||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.TwitterAPI.UserView
|
||||
alias Pleroma.Web.{OStatus, CommonAPI}
|
||||
alias Pleroma.Web.MediaProxy
|
||||
import Ecto.Query
|
||||
|
||||
@instance Application.get_env(:pleroma, :instance)
|
||||
|
|
@ -97,7 +98,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
|||
{:ok, object} = ActivityPub.upload(file)
|
||||
|
||||
url = List.first(object.data["url"])
|
||||
href = url["href"]
|
||||
href = url["href"] |> MediaProxy.url()
|
||||
type = url["mediaType"]
|
||||
|
||||
case format do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue