rich media: add helpers module, use instead of MastodonAPI module
This commit is contained in:
parent
24a103a1fe
commit
8e42251e06
6 changed files with 41 additions and 29 deletions
|
|
@ -12,7 +12,6 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
|||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.Web.MastodonAPI
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
|
||||
defp user_by_ap_id(user_list, ap_id) do
|
||||
|
|
@ -188,7 +187,11 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
|||
|
||||
summary = HTML.strip_tags(object["summary"])
|
||||
|
||||
card = StatusView.render("card.json", MastodonAPI.get_status_card(activity.id))
|
||||
card =
|
||||
StatusView.render(
|
||||
"card.json",
|
||||
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
||||
)
|
||||
|
||||
%{
|
||||
"id" => activity.id,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
alias Pleroma.Web.TwitterAPI.ActivityView
|
||||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
|
||||
alias Pleroma.Web.MastodonAPI
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.HTML
|
||||
|
|
@ -276,7 +275,11 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
|
||||
summary = HTML.strip_tags(summary)
|
||||
|
||||
card = StatusView.render("card.json", MastodonAPI.get_status_card(activity.id))
|
||||
card =
|
||||
StatusView.render(
|
||||
"card.json",
|
||||
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
||||
)
|
||||
|
||||
%{
|
||||
"id" => activity.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue